The VIMOS Public Extragalactic Redshift Survey (VIPERS): The growth of structure at 0.5 < z < 1.2 from redshift-space distortions in the clustering of the PDR-2 final sample