Avoid memory leak and add small optimisation to default Servlet This is part 1 of 3 of the fix for CVE-2014-0119