Toughening of brittle solids by martensitic transformations