Handle per-script values.db file locks.

Fixes #1817
Refs #1798