The HFT can't just know that you're going to place a market order, and then jump in front of all of the other limit orders that you're going to match with, without offering a
better price than the other limit orders.
The only way that could work is if the lowest price you can buy on exchange A is $100, and the HFT knows that you're about to submit a market order, so he buys up the $100 orders until the best price is $101, and then he lists what he bought for sale at $100.99, which your market order matches against. OK, in theory this works.
To avoid this, you can just submit a limit order at $100 instead of a market order. You should always use limit orders for exactly this reason, anyway: even in the absence of foul play, the order you're trying to match against might get matched by someone else in the mean time and you could get a worse price than you expect.