Isospin-breaking corrections and QED finite-volume effects for meson masses and the hadronic vacuum polarisation