bson: track subdocument depth to avoid parent traversal.

This is actually a pretty healthy performance boost. We avoid
traversing the hierarchy which means we also don't pollute the cache
lines so much.