Fix fd leak in query_tty_yesno() on EOF

Reported by:	Coverity Scan
Fix style