Ensure altered schemas are written to ObjectDatabase

WriteTree2 does not write metadata for nodes at the top level of the
tree being written.  I *think* we just need to check for trees
(top-level trees won't have features, right?)

This code causes problems when pushing from repositories with updated
schemas - here is a script I wrote to help me produce affected
repositories while investigating the issue.

> #!/bin/sh
>
> rm -rf states && geogig init states
> # geogig clone states states_remote
> cd states #_remote
> geogig shp import /home/dwins/Projects/geoserver/data/release/data/shapefiles/states.shp -d states
> geogig add
> geogig commit -m 'Imported states'
> geogig shp import /home/dwins/Projects/geoserver/data/release/data/sf/bugsites.shp -d states --alter
> geogig add
> geogig commit -m 'Imported bugsites'

Subsequent to creating a repo this way, the WalkGraph and Push
operations fail due to the missing RevFeatureType for the updated layer.
Merge pull request #827 from dwins/altered-schema

Ensure altered schemas are written to ObjectDatabase