Switch occurrences "if err" to "if err != ENOERR".

Greg had pointed out in his review of my patch for the function exists() that it
is better to use the interface instead of assuming that 0 means there is no
error.  Fixing this in other places.