Fix memory leak with nested objects #1565

See https://github.com/LearnBoost/mongoose/issues/1565#issuecomment-49901228