Notwithstanding subparagraph (A), a warrant officer who would otherwise be discharged under such subparagraph and who is within two years of qualifying for retirement under section
1293 of this title shall, unless he is sooner retired or discharged under some other provision of law, be retained on active duty until he is qualified for retirement under that section and then be retired.