DRILL-1329: External sort memory fixes