move zeroing of byte counter after releasing NAL units
add extern-C markers around windows conditions for c++ compilation