close map file to allow repeat agent loads

This allows the map file to be created more than once.