Ensure reservePort is atomic.