Photon statistics and speckle visibility spectroscopy with partially coherent X-rays