The action-camera maker, struggling with weak sales, makes cuts to save more than $650 million in costs next year.