Change the close interface to return a Future

As the socket closing is treated async, we need to ensure that we can chain
events in Future as needed to handle callback.
The error is as well thus returned as a future if we have any.

Example updated to be able to quit the process once the connection is closed.
Fix typo and call _onDone() once the connexion is closed
_socket is now typoed as Socket and not StringSink

The side-effect was the addition of a mock Socket class to be used during tests.
As we were using StringSink before as a convenient way for the tests to pass
with replacing the Socket by a StringBuffer, changing StringSink to Socket made
the setUp() failing with:
Caught type 'StringBuffer' is not a subtype of type 'Socket' of 'value'.

We now have our own stub Socket for the tests that is conveniently using
a StringBuffer.
Add 2 tests for the closing functionality