Rewrite raw memcard threading code. Intended to fix issue 7484.

Any reason why this is not a vector?