use Blob instead of deprecated BlobBuilder, fix a bug with cordova File.write