Safari undefined str fix

On my application Handlebars throws an error only on Safari and the reason is that there is no control over the string passed to the quotedString method. 
UPDATE
It seems that this patch doesn't work properly, I will make a new pull request, I am sorry for that, just ignore it