A proof of Bertrand's theorem using the theory of isochronous potentials