[M] Change in osmo-trx[master]: ms: rearrange code to allow clean exits