compiler/glsl: avoid null-pointer deref
When we encounter a bindless image here, lower_deref returns a NULL-pointer, and calling record_images_used will try to dereference that NULL-pointer.
So let's dig out the var from the source instruction instead of the result of the lowering.
Fixes: 5910c938 ("nir/glsl: gather bitmask of images used by program")