Ultrafast gain and refractive index dynamics of semiconductor amplifiers measured by four-wave mixing