Support binding sockets

Sockets can now be bound using TCP::bind(). Also added helper functions
to make sockaddr_in and sockaddr_in6 values.

In addition, listen now throws an exception when it fails rather than
doing nothing.
Change argument order of TCP::listen()

This function is often used with lambdas, and passing arguments after
passing a lambda looks very weird and it becomes unreadable.