Fixed generation of unique id values

Fixes #6371.

This resolves an odd bug where the guid() function on occasion generates unique id values that start with a number, which can trip up querySelector and querySelectorAll.

/cc @LaurentGoderre
Okay, will be fixed by #6375. The important thing is that when used for id attribute values that the first character is a letter.