fix API usage of writeAsStringSync

BUG=

Review URL: https://chromiumcodereview.appspot.com//11829010