Allow to bind to port 0 and receive a random port. Fixes #347.