Fix `mongoose.models` consistency bug.

Since `mongoose.models` and `mongoose.connection.models` weren't the
same object, calling `doc.db.modelNames()` didn't return the same output
as calling `mongoose.modelNames()` even if `doc` was an instance of a
`Model` registered to the default connection.

This caused weird problems when using discriminators, since they are
registered with `parentModel.db.model(...)` (which is equal to
`mongoose.connection`) rather than with `mongoose.model(...)`. Using
discriminators, `mongoose.models` ended up having the parent models'
references, while `mongoose.connection.models` had the discriminators
references.

The fix was to set the default connection's `models` property to
`mongoose.models` so that they share the same object. This makes
`mongoose.models` and `mongoose.connection.models` (or
`document.db.models`, `model.db.models`, `model.base.models` etc.)
deterministically equal.
Merge pull request #2197 from yamadapc/3.8.x

Fix `mongoose.models` consistency bug.