AthConfigFlags: add cache for hasCategory
The lookup of flags categories can be very slow for jobs with many flags due to the loop over all flag names and comparison using startswith. Add a cache for already found categories. In principle it would be better to store the flags in a "trie" data-structure but that would require more work (or a 3rd-party library).
Also minor optimization for set and get to avoid duplicate lookups in flags dictionary and streamline error message code.
Edited by Frank Winklmeier