WASHINGTON — President Obama on Wednesday fired his top Afghanistan war commander after only a brief meeting in the Oval Office, replacing Gen. Stanley A. McChrystal with his boss and mentor, Gen. David H. Petraeus, and sending a clear signal that the current war strategy will continue despite setbacks and growing public doubts.