Frequency compensation of three-stage error amplifier