Fixed race conditions in the directAccessFileDriver code.

When a transfer is done in parallel threads, the various calls to changeToRootUser()/changeToUser()/changeToServiceUser() might start happening in different threads at different times. Since the uid/gid of a process is shared by all threads, this would have the effect of a switch to root in one function be followed by a switch to a user in another, which would then cause the desired "root" operation to fail.

The fix is to use a mutex to sequence the operations that are done with switched context.

Signed-off-by: Chris Smith <chris@distributedbio.com>

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5430 ea137bd6-aa86-47b6-b90d-b101d9f19a90