Fix #relative_path_from for identical arguments

When Lockfile#relative_path_from was given identical arguments it would
return nil instead of '.' which would generate an unparseable lockfile.

Now we check and return '.' when the paths are the same.

Part of #1020
Use more expressive condition