feat(db): Add lock on savepoint (refs #5206, #5208)