PIG-1169: Top-N queries produce incorrect results when a store statement is added between order by and limit statements