Fix: ringbuffer: Add file header version field and detect reading corrupted blackbox files using hash value

In the future, if something changes in the file header we can
increment the version and split up the parsing into separate functions
for backwards compatibility.
Fix: refcount leak