Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman

See https://bugzilla.mozilla.org/show_bug.cgi?id=1081317