The VideoCodecFrame and VideoCodecState is C API is unfortunatelly unsafe
by design. So we workarounded it by ensuring the decoder stream lock was
hold while user has a writable reference on those objects.
Based on previous work from Thibault Saunier and Philippe Normand.
Fixes#161