When calling drain_pipeline, we need to set drainingEOS to TRUE AFTER the check
to see if the codec exists. The caps negotiation code calls the exit function
(and hence drain_pipeline) before playback starts to guarantee that the element
state has been reset. Before this change, drainingEOS would be set from the
beginning of execution, which could have some undesired side effects.