After years of surpluses, California headed toward a deficit