Negative thermal expansion and local dynamics in Cu2O and Ag2O