If you are that worried why are you wanting to buy a used car? Go ahead and buy a brand new car spend all that extra money to have warranty. Or take a chance/ have it checked out and go from there. There is no such thing as a flaw free car. Even the new ones have problems.
I beleive you can buy an extended warranty from mazda. Don't know how much but might put your mind at ease.