Valgrind fix

Mike, I think this fixes https://github.com/Metaswitch/sprout/issues/81. I decided to do this via reference counting rather than just using the bits of tdata I need, because I actually need most of it - in particular, I need the actual message in case the IncludeRegisterResponse field is set on the iFC.

I also didn't want to change the ordering of these statements - I think it's a good idea to send the 200 OK out as soon as possible, and only then calculate and send data out to the ASes, rather than holding onto the response until we send some other messages. But maybe I'm overestimating the performance hit of that?