Afghan president replaces security ministers as Taliban advance