glx: Move deref after NULL check