Dynamic port number assignment for the HTTP server and various small fixes

This PR improves the HTTP server in two ways:

 1. The HTTP server now resolves potential port number conflicts upon startup. Those can arise when more than one Driver happen to execute on the same IP address. With this patch, the HTTP server will resolve those conflicts and also make sure that the tracking URL registered with YARN reflects the dynamically chosen port number.
 2. This PR also contains several minor fixes based on code reviews of the HTTP server.