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

I am reasonably sure you understand my point.