How to avoid leakage in the following FFT
Since your frequencies f2 and f3 are a multiple of f1=1k, and since your time vector is until 5 ms, that means your signal fits for a whole 5 periods, harmonics and all, so it's just ripe for a FFT. The problem you're having is that you chose the FFT to be of a number of points (1024) different than the number of samples (1000), so now one bin will be Fs/nfft = 2e5/1024 = 195.31 Hz. If you check the first values of the frequency vector xfft(1:10), you'll see that the first frequency falls in between two bins:
            0
   1.9531e+02
   3.9062e+02
   5.8594e+02
   7.8125e+02
   9.7656e+02 % f1 is between this
   1.1719e+03 % ...and this
   1.3672e+03
   1.5625e+03
   1.7578e+03

The other two have the same symptom. This means the amplitude (which is not normalized, that's why it's ~5k) can't be the real one. When the equivalent DFT will calculate the butterflies, the indices will not match f1 at the same spot. If you would have performed the FFT for 1000 points, the bins would have been 2e5/1e3 = 200 Hz in width. That would have made the frequency vector display these frst 10 values:
      0
    200
    400
    600
    800
   1000 % spot on
   1200
   1400
   1600
   1800

Using a 1024 length FFT means now there are more than one butterfly with different values, and they all add up. Which means you have a mild case of spectral leakage, i.e. the frequency that should have been present in one bin, only, is spreading across its neighbours. Also see the Wikipedia article.