fix FileLock descriptor leak & other fixes
fix FileLock descriptor leak & other fixes

rdar://42598361 (FileLock lock leak on deinit())

* Fix 0644 (0o666 is subject to umask and is actually octal, unlike 0644).
* Allow FileLock to work efficiently with multiple locks/unlocks.
* Fix leak of the file descriptor on `deinit` outside of `withLock`.

JGiola/swift-package-manager,JGiola/swift-package-manager,apple/swift-package-manager,sschiau/swift-package-manager,sschiau/swift-package-manager,apple/swift-package-manager,sschiau/swift-package-manager,abertelrud/swift-package-manager,sschiau/swift-package-manager,apple/swift-package-manager,abertelrud/swift-package-manager,JGiola/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager,JGiola/swift-package-manager,JGiola/swift-package-manager,apple/swift-package-manager,apple/swift-package-manager,sschiau/swift-package-manager