Redshift-space distortions as a probe of dark energy