Follow the behavior as specified in POSIX:
Follow the behavior as specified in POSIX:

if (exists AND (NOT f_option) AND
	((not_writable AND input_is_terminal) OR i_option))
		prompt

in particular, add the test for input_is_terminal

PR:		bin/173039
Submitted by:	Mark Johnston <markjdb@gmail.com>
Approved by:	cperciva
MFC after:	3 days

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase