dirmngr: Refactor 'map_host'.