Fix rare but serious bug in Connection

* Implement output pooling for writing data in connection,
this should fix rare cases where sending would fail