[xpcom] Fix string handling in getJSValueFromIter()