Inferring the Halo Mass Function from Galaxy Clusters: Accuracy Limits Due to Redshift-Space Distortions