Don't open file for writing unless needed
Don't open file for writing unless needed

Summary: This orthogonalizes the lockfile from the manipulation of the underlying file.

Reviewed By: c-ryan747

Differential Revision: D20030181

fbshipit-source-id: 81416efd86bba361a5bb7976c757a7a4bb2c41af

facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl