Fix application crash when calling Shader::isAvailable() #608.

See issue #608.