D-backs break out of slump with win over Cubs