If he told you that he was worried about being fired, then you made the right choice of what to say. Imagine if you'd just shrugged. The only reason you'd respond that way instead of in a comforting way is if you thought there actually was a chance he'd be fired. He'd certainly realize after getting fired that you expected it and that because of that you must not think highly of him.