locks: Split lock-in-fd check in a helper

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
locks: When checking for lock being ours handle mand-locks

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: Don't compare PIDs when searching for our locks

Criu may re-lock the lock, thus spoiling the pid, so compare
the file inode number instead.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>