Reset the state of regex in minimongo on matching

Fixes #2817. Regular Expressions in JavaScript keep the state when matching for
the same string. When there are two documents with the same value of the
matching field, the minimongo can incorrectly filter collection because regexp
would return different values on different calls.
Add tests for #2817
Add comments about regexp flags affected
Fix the regexp issue in Minimongo