Fixes an issue where posix_istty could be called when it isn't defined. Closes #27.