avoid use-after-free in dep resolution

Fixes GHI#82.
Properly quote paths we don't have control over
Merge pull request #83 from KaiSforza/quoting

Properly quote paths we don't have control over
use the constants available for the standard streams instead of extracting them with fileno()
Merge branch 'master' of https://github.com/freestyl3r/cower