save local namespace sans ipy hidden variables and update namespace before exit