Gallery2: Check the validity of effect

There's a contention when effect is released but user still adjust it.
we need check the validity to avoid call member function of an already released object.

Change-Id: Ifdc637f5211670b63dc8ec6b42f3756195d1e88d
CRs-Fixed: 516911