[#2212] CID26263:

Caught null returns to avoid null dereference
[#2212] CID43803:

removed second return statement
[#2222] corrected irods_error for compatibility with file write errors