The Evolution of the Fractions of Quiescent and Star-forming Galaxies as a Function of Stellar Mass Since z = 3: Increasing Importance of Massive, Dusty Star-forming Galaxies in the Early Universe