Optimize performance of access_has_bug_level() api function

Through use of a static array to cache the reporter threshold when
$g_limit_reporter = ON and more importantly reducing the total number of
API calls, the performance of this function has been improved by 65%
(stress tests executed over 2000 iterations, 0.34s vs 0.22s).

Issue #15538, follow up on b3276bbf50abdf53eaa9ef3b20ddb9461aaf1808