Properly close all handlers

* FlushFileBuffers before disconnect
* close all handlers in PipeListener Close()
looks like a typo, should be TestCloseFileHandles