pipeline: Call gst_task_cleanup_all() before checking reference counts after shutdown