Pick port number randomly

Try harder (10 retries) to find available display numbers and try numbers randomly instead of consecutively. Useful to avoid failure because of conflicts when running many jobs on the same machine.