Misc fixes for the 0.6 branch

Here's a small set of patch required to exploit MATTA-2013-004 (CVE-2014-1409) using xcat 0.6.

Might be worth merging if you ever do a maintainance release; I've not checked whether the HTTP-error code handling has been fixed in recent versions