Fix issue #1024 and #1052.

After a cube map uniform is bound through a material, any render call after that would try to reload the cub map when the uniform was bound.

@mramato Can you review this?