NTriples: Newline in final line is optional

According to
http://www.w3.org/TR/2013/NOTE-n-triples-20130409/#grammar-production-ntriplesDoc
the newline at the end of the document is optional, but the current code throws an error in this case. There is even a test which requires an error to be thrown.

I attempted to fix this, including the test. Does it make sense like this? Now let's see what travis thinks ...