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/branches/branch-0.13@1580984 13f79535-47bb-0310-9956-ffa450edef68