Atmospheric origins of perchlorate on Mars and in the Atacama