Make `RegExp.prototype.flags` more spec-compliant

Note that this still isn’t fully spec-compliant, since it shouldn’t be configurable.
What makes you think this implementation won’t work on every browser?