The company suffers in comparison to the same period last year, but sales of tablets and Windows help it beat expectations