Fix crash when setting invalid label with "&" at the end.

We detected that the label was invalid and gave a debug warning message about
it but then still proceeded to crash by accessing the data beyond the end of
the string. Don't do this.

Closes #15665.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775