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

I don't really like the idea of busy-looping here. Could we use an event or something?

Also, this should really be using a Common::Flag or locking before reading the variable.