Four-Wave Mixing in Quantum-Dot Semiconductor Optical Amplifiers: A Detailed Analysis of the Nonlinear Effects