Add drain method to wait until output is transmitted
Fix callback not being fired for a successful flush
Merge pull request #217 from programmarchy/drain

Add drain method to wait until output is transmitted