Follow-up to r1611379: Correctly handle all intermittent errors.

Since the same code sequence has been used for FSFS since 2007,
factor it out into some private API function.

* subversion/include/private/svn_io_private.h
  (svn_io__file_lock_autocreate): Declare new private API.

* subversion/libsvn_subr/io.c
  (svn_io__file_lock_autocreate): Move the file handling code from
                                  the lock() function here and handle
                                  all ordinary and racy errors. 

* subversion/libsvn_subr/named_atomic.c
  (lock): Call the new function and ensure correct thread mutex use.

Found by: brane

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1612405 13f79535-47bb-0310-9956-ffa450edef68
Use the new private lock file API for FS* lock files as well.

* subversion/libsvn_fs_fs/fs_fs.c
  (get_lock_on_filesystem): Call the new API instead using local code.

* subversion/libsvn_fs_x/transaction.c
  (get_lock_on_filesystem): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1612407 13f79535-47bb-0310-9956-ffa450edef68