If port specified is not available or invalid, try another port or exit with an error