NXP-11222: properly handle the exit status of the sub processes