Fix memory leak

This the pull request is about memory leak reported by @YvesDup in #57.

I think this need to be merge in binlogstream before merge of the pull request.