Add finish_parsing function.

I've added the finish_parsing function. Based on these changes the calling application
will now call this function when the stream has come to an end and the parser should
do it's final operations.
Merge pull request #176 from RickEyre/finish-parsing

Add finish_parsing function.