correctly strip out invalid compiler flags for mysql_config.

note: previous commit did not strip all invalid flags and stripped out
      an additional flag "-Wall"