Fix #42: Try random ports until an available one is found.