output-json: fix duplicate logging

This patches is fixing a issue in the OutputJSONBuffer function. It
was writing to file the content of the buffer starting from the start
to the final offset. But as the writing is done for each JSON string
we are duplicating the previous events if we are reusing the same
buffer.

Duplication was for example triggered when we have multiple alerts
attached to a packet. In the case of two alerts, the first one was
logged twice more as the second one.

Redmine tickets: https://redmine.openinfosecfoundation.org/issues/1337

PR builds:
- PR build: https://buildbot.openinfosecfoundation.org/builders/regit/builds/24
- PR pcaps: https://buildbot.openinfosecfoundation.org/builders/regit-pcap/builds/22