Remove custom terrain when clearing resources.

Fixes #4272.