[3014]Avoid NPE when closing Elexis. Better error messing for lock files