optimize: cache the match captures table for ngx.re.gsub() when a function-typed "replace" argument is specified. this gives a remarkable speedup.