Fix writing to external sdcard

Change-Id: Iab941732cf2c65fdfc6d6f838badd24cd16037c5
Merge remote-tracking branch 'cm/cm-11.0' into kitkat