Fixed a series of segfaults caused by freeing
memory after calling tm_request from do_tcp too
soon. TRQ-2256