A lack of innovation, tough competitors, and an ill-fated lifeline from Amazon humbled the Bedford-based tech legend.