binary search tool: Add file locking to compiler wrapper

Because make can run with arbitrary number of jobs, there's potential
race conditions with the compiler wrapper's file operations. Replace all
open calls with function that locks files using fnctl module.

Additionally fix small formatting errors

CQ-DEPEND=CL:*270783

Change-Id: I4b94bfe3c0a5d7203f78e87130b7c4d71bc8e1c0
Reviewed-on: https://chrome-internal-review.googlesource.com/271747
Commit-Ready: Cassidy Burden <cburden@google.com>
Tested-by: Cassidy Burden <cburden@google.com>
Reviewed-by: Luis Lozano <llozano@chromium.org>
1 file changed