[#1239] Fix possible NPE while fail flush futures during close