Comparison of H I and optical redshifts of galaxies - the impact of redshift uncertainties on spectral line stacking