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

With any half-decent compression algorithm that shouldn't be a problem at all.