fix(db): Use pg_advisory_xact_lock (refs #5206)