Misc op5 fixes

This is a bit of a mixed bag of commits.

The first half are proper bug fixes that I've ported from op5's patchqueue for nagios ( http://git.op5.org/gitweb?p=monitor%2Fnagios.git;a=shortlog;h=HEAD )

The latter half were written while packaging naemon core. They are there to "make more things more standard".
Well... humm... I won't call it forward declarations though... I like to add prototypes to all my functions in C, where static functions is declared in the .c-file and non-static in the corresponding .h-file...

Nothing really to comment on here though... Just a small note. :)