Lily, that is exactly what is meant, I think. It is reinforced a little later when Mycroft says, "I'm not lonely, Sherlock." And Sherlock replies, "How would you know?"
After two years away, Sherlock has matured and learned the value of the "goldfish" in his life, primarily John, but also Mrs. Hudson, Molly and Lestrade. Mycroft presents us with a contrast to Sherlock here. Previously, they seemed two peas in a pod regarding the need for others in their lives, but now, Sherlock recognizes that he himself had been lonely in the past, and has a new-found appreciation for his friends.