XWIKI-9779: XWiki.Registration executes $doAfterRegistration twice

Added a comment explaining the significance of toString() and applied the patch to xwiki-platform-wiki-ui which duplicates the code.