Revert "Fix a O(n^2) algorithm in regdb_fetch_keys()"