Local structure and valence states in Ba2YCu3Oy studied by x-ray absorption fine structure