basetransform: Fix race when toggling passthrough
@stianse
Submitted by Stian Selnes Link to original bug (#773093)
Description
This fixes a race where priv->passthrough is changed from TRUE to FALSE
while processing a buffer and we end up passing a non-writable buffer to
transform_ip(). More precicely if passthrough is changed just after
prepare_output_buffer() is finished.
Since priv->passthrough and other priv variables are accessed throughout
the chain function a lock is introduced and held while processing the
buffer, but released before pushing downstream. Since sub-classes may
call is_passthrough() and similar functions during for instance
transform_ip() a recursive lock is needed.