Exact solutions of the Klein–Gordon equation in the presence of a dyon, magnetic flux and scalar potential in the spacetime of gravitational defects