libsdhcdrivers: Improve read and write functions

Code was refactor so that it is more bulletproof to memory leak as
clean is done only at the exit of the function or in the callback.
1 file changed