Add more compile checks and fix nitpicks

This brings us in line with the most aggressive varnish-cache compile
options. The const-correctness fixes also paves the way for fixing all
these memory leaks.