Why shouldn't the pilot change the aircraft's configuration while avoiding windshear during landing?
As far as landing is concerned, it is better to leave the landing gear down because if something goes down and the aircraft touches the ground, it is better to do so with the landing gear rather than the aircraft fuselage. Also, the retraction process may increase drag, not what is desired.

During landing, the retraction of flaps (which may be already at their max) can cause loss of lift (as you noted). Reduced airspeed due to windshear causes loss of lift; retracting the flaps in this condition is not desirable.

There is also the point that during the critical moments when the pilots are trying to pilot the aircraft during wind shear, their attention should be in flying the aircraft and not in fiddling with controls.

From FAA Advisory Circular 00-54 Pilot Windshear Guide:


  CONFIGURATION
  
  Maintain flap and gear position until terrain clearance is assured. Although a small performance increase is available after landing gear retraction, initial performance degradation may occur when landing gear doors open for retraction. While extending flaps during a recovery after liftoff may result
  in a performance benefit, it is not a recommended technique because:
  
  1) Accidentally retracting flaps (the usual  direction of movement) has a large adverse impact on performance.
  
  2) If landing gear retraction had been initiated prior to recognition of the encounter, extending flaps beyond a takeoff flap setting might result in a continuous warning horn which distracts the crew.