Updated sdmc detection code for latest ctrulib. Added some header includes to fix warnings.