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

This is how it looks in 4-space editor:
![capture](https://cloud.githubusercontent.com/assets/113063/3872501/32f180aa-211d-11e4-8969-8d0d70e8519d.PNG)
Should it be different?