Finds the port object corresponding to the given id.
This method is thread-safe while the pipe is running.