Pass O_CLOEXEC to all calls to open()

There's no reason for our subprocesses to share our file descriptors.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>