pty: Narrow the race on ldisc locking