Bug 838955 (part 2) - Fix rooting hazards in jsstr.cpp identified by static analysis.  r=sfink.

--HG--
extra : rebase_source : 7a2de0680f6f82a0c40bea46a520af1a5ad72fbc