Properly close all handlers

* FlushFileBuffers before disconnect
* close all handlers in PipeListener Close()
Merge pull request #10 from gabriel-samfira/add-test

Properly close all handlers