[hack] fix Lock.check when lock's dir doesn't exist
[hack] fix Lock.check when lock's dir doesn't exist

Summary:
if the lock file's directory doesn't exist, then `open_out` will throw a Sys_error trying to create an output channel. all of the other lock operations make sure the dir exists, except for `check`. so, checking to see if a lock exists can throw if the lock doesn't already exist... >:(

another fix is to catch the `Sys_error` in `check` and say that a non-existant parent dir means the lock file is unlocked, but there's not a super portable way to catch that specific error; `Sys_error` is generic so it would involve string matching. just creating the dir seems fine because we're going to try to grab the lock soon anyway.

Differential Revision: D6460013

fbshipit-source-id: 53f7cd6b98e5e0e4ced4113ca991730753153981

mroch/flow,popham/flow,samwgoldman/flow,gabelevi/flow,nmote/flow,popham/flow,samwgoldman/flow,JonathanUsername/flow,facebook/flow,jamesgpearce/flow,JonathanUsername/flow,samwgoldman/flow,jamesgpearce/flow,popham/flow,mroch/flow,jamesgpearce/flow,claudiopro/flow,claudiopro/flow,gabelevi/flow,gabelevi/flow,jamesgpearce/flow,gabelevi/flow,nmote/flow,AgentME/flow,JonathanUsername/flow,samwgoldman/flow,mroch/flow,JonathanUsername/flow,jamesgpearce/flow,gabelevi/flow,gabelevi/flow,facebook/flow,nmote/flow,popham/flow,claudiopro/flow,AgentME/flow,jamesgpearce/flow,AgentME/flow,popham/flow,mroch/flow,JonathanUsername/flow,claudiopro/flow,popham/flow,facebook/flow,jamesgpearce/flow,samwgoldman/flow,nmote/flow,mroch/flow,JonathanUsername/flow,facebook/flow,samwgoldman/flow,mroch/flow,AgentME/flow,JonathanUsername/flow,claudiopro/flow,nmote/flow,AgentME/flow,samwgoldman/flow,nmote/flow,gabelevi/flow,nmote/flow,facebook/flow,popham/flow,facebook/flow,facebook/flow,mroch/flow