Merge smerrill's Varnish 4 fixes + malloc support

These changes look good - I take it you're happy with me merging @smerrill ?
Looks like I am missing an end quote here. Let me fix that up and then I'd be fine with the merge.