lib: Fix some memory leaks
lib: Rearchitect trace file parsing to use GDataInputStream

Use GDataInputStream rather than a home-grown buffering solution which
broke if the string it was searching for (‘\n> ’ or ‘\n< ’) was split
over a 1024 byte boundary.
lib: Don’t try and treat a character literal as a string pointer

There is no way that’s going to give a valid address.
lib: Fix parsing of messages in comparison mode

This check was previously triggering parsing of a message as soon as the
first separator was encountered, at the end of the request. Message
parsing should only happen at the end of the response, so change the
check to use the state machine which already exists for this purpose.