Properly sanitize more escape characters in string literals

r? @benvie

https://bugzilla.mozilla.org/show_bug.cgi?id=983970