bgpd,lib: fix compiler warnings, memory cleanups for valgrind

    Description:
        We use valgrind memcheck quite a bit to spot leaks in
        our work with bgpd. In order to eliminate false positives,
        we added code in the exit path to release the remaining
        allocated memory.

        Bgpd startup log message now includes pid.

See https://lists.quagga.net/pipermail/quagga-dev/2013-April/010455.html