Signal fixes

* Don't close file descriptors we don't own.
* Fix cf-serverd stat()'ing the file tree every second.

Only the first commit needs to be reviewed. The second commit is identical to the one already reviewed in https://github.com/cfengine/core/pull/1031. It was reverted because a test failed, but the first commit here fixes that.