look for `lock` file instead of `webappsstore.sqlite-shm` to detect if firefox is running or not (with this profile) see https://github.com/ghacksuserjs/ghacks-user.js/pull/405#issuecomment-581447586 and follow-up comments. Thanks @atomGit for reporting the issue and @rusty-snake for confirming it.
Port of the prefsCleaner.bat for anything(?) with a bash shell.