[omxcodec] Do the cleanup in main thread to avoid race condition crash on exit