Role of the microstructure on the magnetic properties of Co-doped ZnO nanoparticles