Fix up leaks
Merge pull request #246 from Metaswitch/further-proxying-support

No reviewer needed - Fix up leaks