Fix race condition in finish_unprepare
The previous fix for race condition around finish_unprepare where the function could be called twice assumed that the status wouldn't change during execution of the function. This assumption is incorrect as the state may change, for example if an error message arrives from the pipeline bus.
Instead a flag keeping track on whether the finish_unprepare function is currently executing is introduced and checked.
Fixes #59 (closed)