Improved logic in new head state creation.
Earlier any IOException during the reading of head state was interpreted
as empty DB. This might cause unwanted DB reset. It's better to identify
need for empty head state based on main state head directory.
Switched AcornDatabase.start logic back to using RandomAccessFile for
touching the db/lock file. Using RandomAccessFile instead of
FileSystemProvider.newFileChannel in Windows better prevents any other
process from removing the lock file. The newFileChannel version did not
prevent the user from initially running 'del lock' to remove the file -
although the file will be recreated quickly by the system.
Also AcornDatabase.start now re-throws ProCoreException if
opening/locking the lock-file fails with IOException to prevent the
system from attempting to start up without a proper database to work
with. Previously the system just logged the start-up problem and
continued.
refs #7124
Change-Id: I850b47d8f692e3d1b8ce177b9269540edc4dc272
(cherry picked from commit
25c9cc192b2611646b0a476bf205484500e92997)