(Semi-)retire my_free() in favour of nm_free()

This commit replaces all internal uses of my_free with the equivalent
nm_free macro. This makes things a whole lot less surprising and much
more consistent with the memory allocation API we already have. I
should've done this when I introduced nm_alloc in the first place, but
better late than never.

Semi, because my_free() is exported as a part of the library for whatever
reason, so removing it would break API, needlessly.

Signed-off-by: Anton Lofgren <alofgren@op5.com>
Introduce nm_log() and deprecate logit()

logit() lacks the 'nm_' prefix and is as such not marked as a
stable api, but it's also exported.

While at it, we get rid of the 'display' variable, which was
hardly ever set to anything but TRUE. That in itself was a bit
weird, since we want messages to be printed to the console when
we're running in debug mode in the foreground and they're
blocked from the console when we're in debug mode. TRUE is
now the default for "nm_log()", meaning logmessages will be
printed to the console when they're available.

logit() is left as an exported function, but its prototype is
given the gcc attribute 'deprecated' to warn users not to use
it.

Change-Id: I880ba1c5072bf3af2cc3d15e9320165a316a5f8b
Original-patch-by: Robin Sonefors <ozamosi@flukkost.nu>
Signed-off-by: Andreas Ericsson <ae@op5.se>
logging: Sanitize API

A person who just wants to log a line somewhere should not have to even
consider whether it goes to syslog or a log file. Stop exposing those
functions - noone wants them available outside of the logging module
itself.

Exposing write_to_log(), write_to_syslog() and write_to_all_logs()
really doesn't make any sense. write_to_all_logs() is unfortunately
used by mod_gearman, so we deprecate that and make the other two
static in order to completely prevent them from being (mis)used.

This patch originally came from Anton Lofgren, but was modified for
inclusion in naemon in order to keep mod_gearman building properly.
Authorship is preserved as Anton though, as my modifications are
just minor ones.

Change-Id: I550a57dddef7a2c210930e56b8b0754e8fb2792c
Original-patch-by: Anton Lofgren <alofgren@op5.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>