Cleanups from testing branch. #3813

- Actually turn on USE_SHARED_PORT by default as the branch suggests.
- Fix bug on IPv6 socket binding caused by default arguments to bind.
- Avoid binding the UDP socket twice.