shared-mem-locks: add a check