Fix #290, add permissions to osqueryd logging

Expose a `writeTextFile` that let's the caller open a text file with restrictive ACL permissions. 

The use of `open`, `write`, `close` and not C++/boost stream APIs is intended. Since ACLs diverge across OSes permissions are implemented in compiler/libraries. We are wearing unix goggles so `open` works. 

The `osqueryd.results.log` file may in the future contain sensitive information. Currently, on OS X, with and suid `ps` it already contains potentially sensitive application arguments/ENV variables.