Add support for assigning a random port to HTTP/HTTPS

This is a port of the changes from https://github.com/grails/grails-core/pull/414 since the plugin was moved into its own repo starting with 2.3.0