pep8 cleanup on get_random_open_port function

Tried adhering more strictly to PEP8 coding style.