Local structure of YBa2Cu3Oy with varying oxygen content and substitutional dopants on the Cu sites