Thousands of jobs saved with new UK military deal