MediaSet: Create a shared_ptr to avoid bad_weak_ptr exception while element is waiting for a thread

Change-Id: I8692891141db79df08bee647632666d86a2dfd01