closeOnEndOfFile respected in FBFileReader redux
closeOnEndOfFile respected in FBFileReader redux

Summary:
D19648270 had to be reverted due to a new crasher introduced. The change that this diff made was completely valid to avoid pipe-leakage in a subprocess path, but enabling it revealed an "early close of fd behind the back of libdispatch" problem that has since been rectified in D19791187

Now the `closeOnEndOfFile` flag will be properly respected and the closing will occur after the dispatch channel has completely relinquished control of the file descriptor. The sole relinquishment channel is in the callback of `dispatch_io_create` which will always call it's `cleanup_handler` last, including any `dispatch_io_read` callbacks which are "done". The cleanup handler is the best way of knowing that an IO channel has been relinquished.

run_all_tests

Reviewed By: c-ryan747

Differential Revision: D19663146

fbshipit-source-id: c353632629aa341329e9d5845ca901e604617fc1

facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl