Fix findPid since pty uses \r\n as line ending