preserve the original flags so pattern caching works properly

This adds a new property to the regexp structure, "compflags",
and related macros for accessing it. We preserve the original
flags passed into the compilation process, so we can compare
when we are trying to decide if we need to recompile.

Things are a touch tricky as the UTF8 flag is handled specially.