Add a wrapper for open.

This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).
Update for llvm API change.
Update for llvm API change.
Update for llvm API change.