Apple topped global smartphone shipments in the first quarter, marking a 5% year-on-year increase despite industry-wide challenges.