use random port

if port 9999 is in use the tests will fail because the port is hardcoded
I have added a try/catch with Random. It fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755320
do not raise an other exception, use the orginal
support all ruby versions
Merge pull request #455 from hggh/random_port_tests

use random port for tests