The fundamental force carriers are gauge bosons and the gauge-symmetries forbid them to have a mass. The only way they can gain a mass is through the Higgs mechanism, as in the case of the W and the Z, i.e. the gauge symmetry has to be spontaneously broken.
So in a sense you are right, the fundamental force mediators should be massless but not for the reason you have given and there is a get out clause if the Higgs mechanism is at play.
But the pions are not fundamental force mediators and are not gauge bosons so they are not required to be massless for this reason. However there is an interesting twist to all this: One can in fact understand the pions as the Nambu-Goldstone bosons of the spontaneously broken chiral symmetry (broken by the non zero vacuum expectation value of the quark condensate). If the chiral symmetry were exact then the pions would indeed be required to be massless (by Goldstone's theorem). However the chiral symmetry is only an approximate symmetry as it is explicitly broken by the quark masses. For this reason the pions are allowed to have a (small) mass and are thus called 'pseudo'-Nambu–Goldstone bosons.
I hope the above helps to explain the situation in relation to the masses of the force mediators and the pions. However I sense that your real confusion is in the fact that you cannot understand how a force mediator can have a mass as you think this will in some way effect the interacting particles in a way that is not observed. You seem to be worried about the interacting particles having to create and destroy mass. But why be so concerned about mass? Even with a massless force mediator the interacting particles still need to create and destroy the energy of the transferred mediator and mass is simply one form of energy, so by your reasoning you should be equally well concerned about both massive and massless force carriers.
But your reasoning should just not concern you, why are you worried about this constant exchange of energy? After all, the particles are interacting and how else could they do this? A very simple analogy of how exchange of a massive particle could create a force would be if two people sat in boats and kept throwing a heavy ball between each other, they would move apart and the exchange of the massive ball would appear to be producing a repulsive force.
The above analogy does not get too close to the real situation and would for example fail to explain attractive forces, but it at least shows that you should not be concerned about the transfer of mass or energy in such a situation. To really understand how virtual particles can transmit a force then you have to do the calculations and understand that virtual particles are really not particles at all but are non-particle like disturbances in their respective fields. You should also remember that any interacting particle is constantly creating and destroying virtual particles in its vicinity - the creation and annihilation of virtual particles are simply part and parcel of the definition of the particle in the first place.