Account for the fact that some file-like objects may not have a isatty() method.

Conflicts:
	fabric/utils.py
Changelog re #1019, closes #1019, closes #1022, closes #1186