That is because you would be acting in legitimate self-defense squashing the mosquito - the only time violence is acceptable. All other violent acts are in karmic vain.
Otherwise we can just be picked off one by one.
And it can be even worse, in some areas of the world a mosquito bite can indirectly kill you. I think it's pretty much the only situation where it's justified. Unless we can invent a better solution at least.