Starbucks posted its first revenue and earnings growth in over two years, with CEO Brian Niccol crediting operational improvements and updates to its loyalty program for driving more customer visits.