The three loop QED contributions to the photon vacuum polarization function in the MS scheme and the four loop corrections to the QED beta function in the on-shell scheme