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

Any reason to use a vector? There is no reallocation needed and we already kept track of the size.