fix #2434 remove side effect of #1638 for 3.8.x

Rebase https://github.com/LearnBoost/mongoose/pull/2435 to 3.8.x branch