HIVE-6700: In some queries inputs are closed on Tez before the operator pipeline is flushed (Gunther Hagleitner, reviewed by Vikram Dixit K and Siddharth Seth)

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1580942 13f79535-47bb-0310-9956-ffa450edef68