Avoid memory leaks from huge string allocations.

See: https://github.com/Pylons/pyramid/pull/1417