setting pipeline to NULL before unref