Correct datadir lock detection in bitcoin.cpp
Correct datadir lock detection in bitcoin.cpp

This does an early check for the ability to lock the data directory
and corrects a segfault condition if the lock is not obtainable.

gridcoin/Gridcoin-Research,caraka/gridcoinresearch,gridcoin/Gridcoin-Research,gridcoin/Gridcoin-Research,Git-Jiro/Gridcoin-Research,caraka/gridcoinresearch,caraka/gridcoinresearch,caraka/gridcoinresearch,Git-Jiro/Gridcoin-Research,Git-Jiro/Gridcoin-Research,gridcoin/Gridcoin-Research,gridcoin/Gridcoin-Research,Git-Jiro/Gridcoin-Research,caraka/gridcoinresearch,Git-Jiro/Gridcoin-Research,caraka/gridcoinresearch,gridcoin/Gridcoin-Research