The lock file was ineffective because opening leveldb storage in read-only mode doesn't really take the lock. Fix it by including a dedicated flock library (which is actually split out of goleveldb).