(#3062) - fix mapreduce error

Sorry for no tests; I wasn't sure what exactly was needed to get a failing test.

In any case, we already have some failing tests: the mapreduce tests. I'll open up a PR over there to demonstrate that this fixes the issue.
^ btw, this is the one-liners I was talking about in https://github.com/pouchdb/pouchdb/pull/3063