tty: Refactor wait for ldisc refs out of tty_ldisc_hangup()