Fix bug that causes texture assignments to be sometimes optimized away incorrectly if materials that are not clones of each other happened to share the same underlying program instance.