Fix logger to not crash on fatal errors

When an error is triggered with error(), representing
its flags as a string yields a NULL value, which
makes the program crash when we run string_replace on it.
Fix wrong config file path mention in the README

The program expects the default/template rules file to be named
`rules.conf.dist`, not `rules.conf` as previously mentioned.
Create target file's parent directory before touching the file

This is the equivalent of doing a `mkdir -p` on the file's
parent directory before trying to copy to the file.