backporting store locking
added test for readonly databases not being allowed to share store files
backporting store locking
Merge pull request #542 from lassewesth/storelockingbackport

backporting store locking