Smartphones power record Samsung profit of $5.9 billion during Apple lull