Ericssons vinst kommer in bättre än väntat och försäljningen faller mindre än vad analytikerna trott.