core: Avoid opening log_file before dropping privileges

Doing so means we can potentially create the logfile as root,
and then never be able to write to it as the user we're
supposed to run as.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/nspath: Add nspath_mkdir_p()

This is in preparation for letting Nagios set up directories and
whatnot as required, without requiring too much user intervention
beyond setting the proper permissions.

This is currently untested code, but since it's also unused, I'm
not too fuzzed atm.

Signed-off-by: Andreas Ericsson <ae@op5.se>