pty: reconnect the BSD TIOCSPTLCK handling to legacy ptys