Added flag to enable CPU profiling and adapted API to support port number 0 (auto-assign)

Profiling
---------
In order to support profiling it was necessary to modify the main loop and
draining function to ensure that the main function exits cleanly.
It turns out the profile is not written to disk if the program does not exit
cleanly.

Auto-assigned port number
-------------------------
I was a little surprised that this was not supported, I guess most torrent
client determine their port number and only then set up the DHT.
Nonethess less I think this is an interesting feature to have.