Twitter bounced back from a dodgy start in 2014, with a second-quarter earnings report that showed a surprise profit and user growth that beat expectations.