The maker of TurboTax and QuickBooks will cut about 3,100 jobs and close two offices, triggering up to $340 million in charges