In 2011, T-Mobile lost $4.3 billion and Legere said it was “a total mess”. Here's how he turned it around