OK, at least, it's a not bad start, it doesn't crash :) Please give the dmesg output after inserting / removing the SD card. (And the device should be not /dev/sd* but /dev/mmc0p* or such, in anyway.) I'll put some debug prints to track more deeply. Stay tuned.