Relation between phase stability and mechanical defects in InGa(Al)As/GaAs and ZnSe/GaAs heterostructures under pressure