Finite-volume QED corrections to decay amplitudes in lattice QCD