optimize: local-ize global variables in the resty.core.misc module.