X-ray absorption study of the evolution of unoccupied Cu-O states in high temperature superconductors with O deficiency and Zn doping