Make listening port for examples to be settable.

This will be better for our own internal tests.