Accurate determination of the rotational constants of ultracold molecules using double photoassociation spectroscopy