Add a new thread to remove elements from internal pipeline

Callbacks to process EOS events are managed in the encodebin's streaming thread.
This prevents the encodebin from being removed from the pipeline so we need an
external thread to manage this stuff.

Change-Id: I7bea733ab22cf65118d58c9695885fefd859c25b