AP_Terrain: prevent disk blocks getting stuck

we need to match first on the expected state to ensure we don't get an
invalid block