comments: Fix code for ensuring unique comment id

The code tried to ensure it wouldn't overwrite anything by always
looking up the next_comment_id, and if it existed due to weird reasons,
it would increase next_comment_id until it found a comment id that was
completely free.

The problem is, it only checked if there was a host comment when it was
adding a host comment, and only if there was a service comment when it
was adding a service comment. As host and service comments belong to the
same array, we need to check if either of the two comment types already
hold the next_comment_id slot, or else the two comment types will risk
overwriting each other's comments.

Change-Id: Id450e54d8f72dfdf9676250268b0ea659fc16a87
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
Add main config include support

This works by you adding (probably) include_dir or (unlikely)
include_file into your nagios.cfg, and point it to a file where modules
can dump their config. If you use include_dir, make sure your config
files are called whatever.cfg, or naemon will proceed to ignore the
file - this lets a user dump, say, a README file into their config dir,
without naemon complaining that it's not a valid config file.

The settings in the subfile(s) are included as if the contents of the
subfile had been at the line that contains the include line, just like a
C preprocessor statement.

Perhaps unintuitively (or not, depending on what your intuition tells
you), all relative paths are relative to the main config file. While
it's not the case technically, you should pretend that naemon chdir()ed
into the directory where the main naemon.cfg file is located, and then
resolved all paths relative to the cwd.

In order for this to work with cfg_file and cfg_dir statements - which
used to be parsed by a separate nagios.cfg "parser" (because why
anything?), I've introduced two more globals. I feel very bad about
this.

Change-Id: I61165280ea0ef7a48e5bfdd8bc6019f9fa84401b
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
utils: Improve const correctness

These are globally allocated strings, and you may not free them.

Change-Id: I02a3d83862ceb9c3a93ea9191659678a8ee18f8a
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>