db: bugfix in processing of commit_after parameters, try to avoid locking db during checks