Fix: bug in TerrainLayer; no NULL check on tileSource when setting the cache policy