Fix regression in location_modules() where entries with same priority weren't returned in order of decreasing prefix length.