Issue #2177739 by Berdir, alexpott, Gábor Hojtsy: Fix inefficient config factory caching.