add debug messages for pty allocation / deallocation, to debug #137 and #147