From The Sadness of Christ:
For the ancient fathers of the Church give us
counsel to beware that none of us, upon overmuch confidence of our own strength, should willingly
without discretion bring ourselves in danger haply to displease God. And therefore, if any man
misfortune to come in such place, where he perceiveth he shall be in hazard to be forced to offend God,
there would I advise him to do as the apostles did here, which before they were taken speedily got them
their way.
Yet Saint Thomas did not flee, although he had many friends on the Continent to welcome him and his family. He deliberately chose the path which likely would end in his martyrdom.