streaming: add callback OnDone to decoder
Created by: stefanhengl
It's convenient to know when all events have been processed and the decoder is just about to return.
For example, the src-cli has to output a valid JSON from a stream.
Besides the results, the final JSON should also contain top-level
metadata like alerts or progress data. A callback OnDone
gives us a
natural hook to add metadata and close the JSON object.