A global agreement in 1987 to ban chemicals harming the ozone layer is working, scientists say.