UK defence chiefs have taken on a semiconductor factory near Darlington after fears its closure could leave projects in the lurch.