invert error check for POSIX filesytem functions

This fixes #104, by using the correct interpretation of the return value from most of the posix file functions.