fix wrong logic added by commit: 28facd2688a6f7ebfa237f036e8910fce0fd1659.
If a shader is attached to a program, this shader can not be destroyed.