Fix race when finding the port OpenOCD is using.