pty: add read_password helper