request_rewrite: Fixed a problem with requests that caused memory not to be freed until the root request was complete.
request_rewrite: Added a test that ensures that request resources are freed as soon as possible, to avoid temporary memory leaks.