[hack] Fix `input_value: bad object` in build
[hack] Fix `input_value: bad object` in build

Summary: This is probably one of my better one-line fixes...

`input_value: bad object` is the result of the Marshal module trying to
unmarshal something that doesn't look like a marshalled OCaml object. Some
investigation revealed that it was failing to unmarshal the string "ready",
which is sent during the server startup phase, on an entirely different channel
altogether.

How does data from one channel find itself being written to another, and why
does using close_out instead of Unix.close fix things? Well, OCaml channels are
buffered, and Linux reuses file descriptors. So `Unix.close` would close a file
descriptor while retaining the OCaml channel buffer, and then Socket.accept
would reuse that fd value for the client connection. At some point we would
flush the old buffer, causing the client to read the stale data.

One might notice that wakeup_client calls `flush` immediately after writing its
value, so the OCaml buffer should get emptied... unless the client isn't trying
to read that value (which is true when doing build). So an exception gets
thrown, which we ignore, and the OCaml runtime keeps around the buffer that it
failed to flush (which is probably a shortcoming on its part).

This regression was introduced in {D2367655}.

For the curious, the OCaml channel code can be found at
https://github.com/ocaml/ocaml/blob/ac62e93d6b61ae76e18dee530b7f3969ef690219/byterun/io.c

Reviewed By: @jwatzman

Differential Revision: D2405802

nmote/flow,chenglou/flow,fletcherw/flow,gabelevi/flow,graue/flow,siddhartharay007/flow,chenglou/flow,KevinTCoughlin/flow,mroch/flow,JonathanUsername/flow,darioajr/flow,samwgoldman/flow,AgentME/flow,JonathanUsername/flow,cesarandreu/flow,MichaelDeBoey/flow,ylu1317/flow,JonathanUsername/flow,JonathanUsername/flow,KevinTCoughlin/flow,cesarandreu/flow,JonathanUsername/flow,nmote/flow,OCamlPro/flow,popham/flow,chenglou/flow,cesarandreu/flow,gabelevi/flow,jeffmo/flow,gabro/flow,jamesgpearce/flow,samwgoldman/flow,facebook/flow,shiftcars/flow,popham/flow,d14b3l/flow,siddhartharay007/flow,AprilArcus/flow,jdelStrother/flow,chenglou/flow,jeffmo/flow,jeffmo/flow,graue/flow,paulshen/flow,OCamlPro/flow,OCamlPro/flow,jeffmo/flow,paulshen/flow,Wanderfalke/flow,facebook/flow,jgrund/flow,Wanderfalke/flow,popham/flow,asivitz/flow,JohnyDays/flow,shiftcars/flow,claudiopro/flow,fletcherw/flow,claudiopro/flow,gabelevi/flow,claudiopro/flow,ylu1317/flow,mroch/flow,d14b3l/flow,mcanthony/flow-type,KevinTCoughlin/flow,jgrund/flow,AprilArcus/flow,KevinTCoughlin/flow,AprilArcus/flow,jdelStrother/flow,jeffutter/flow,mcanthony/flow-type,TiddoLangerak/flow,darioajr/flow,cesarandreu/flow,TiddoLangerak/flow,AgentME/flow,ForbesLindesay/flow,claudiopro/flow,gabro/flow,gabelevi/flow,JohnyDays/flow,fletcherw/flow,popham/flow,mroch/flow,jeffutter/flow,nmote/flow,samwgoldman/flow,ylu1317/flow,AprilArcus/flow,fletcherw/flow,jdelStrother/flow,fletcherw/flow,graue/flow,JohnyDays/flow,MichaelDeBoey/flow,OCamlPro/flow,jgrund/flow,asivitz/flow,popham/flow,jeffmo/flow,ForbesLindesay/flow,shiftcars/flow,paulshen/flow,gabro/flow,facebook/flow,Eyyub/flow,darioajr/flow,TiddoLangerak/flow,JonathanUsername/flow,shiftcars/flow,jamesgpearce/flow,jeffmo/flow,jdelStrother/flow,facebook/flow,ylu1317/flow,popham/flow,danvk/flow,jgrund/flow,jgrund/flow,chenglou/flow,facebook/flow,MichaelDeBoey/flow,jamesgpearce/flow,asivitz/flow,gabelevi/flow,nmote/flow,danvk/flow,mroch/flow,MichaelDeBoey/flow,AprilArcus/flow,Eyyub/flow,AprilArcus/flow,Wanderfalke/flow,jgrund/flow,shiftcars/flow,claudiopro/flow,jeffutter/flow,samwgoldman/flow,mcanthony/flow-type,asivitz/flow,ForbesLindesay/flow,Fresheyeball/flow,siddhartharay007/flow,d14b3l/flow,ForbesLindesay/flow,gabro/flow,Eyyub/flow,jamesgpearce/flow,samwgoldman/flow,graue/flow,danvk/flow,TiddoLangerak/flow,gabro/flow,gabelevi/flow,facebook/flow,TiddoLangerak/flow,darioajr/flow,popham/flow,gabro/flow,mroch/flow,shiftcars/flow,JohnyDays/flow,gabelevi/flow,siddhartharay007/flow,facebook/flow,chenglou/flow,jeffutter/flow,paulshen/flow,ForbesLindesay/flow,d14b3l/flow,AgentME/flow,Wanderfalke/flow,fletcherw/flow,Eyyub/flow,AgentME/flow,ylu1317/flow,jamesgpearce/flow,graue/flow,danvk/flow,nmote/flow,graue/flow,Fresheyeball/flow,nmote/flow,samwgoldman/flow,Fresheyeball/flow,AgentME/flow,d14b3l/flow,mcanthony/flow-type,ForbesLindesay/flow,d14b3l/flow,jamesgpearce/flow,mroch/flow,MichaelDeBoey/flow,mroch/flow,samwgoldman/flow,nmote/flow,jdelStrother/flow,JonathanUsername/flow,Fresheyeball/flow,jamesgpearce/flow,jdelStrother/flow