Fix crashes caused when terrain materials don't get created (e.g. due to cg shader bug on Windows/D3D9).  Should resolve Bug #1284.