PCs are dying, so Logitech pivoted to tablets—and had a surprisingly profitable quarter