wxRadioBox::m_radioButtonCycle is never null -- except when it is, when
there are no items at all in the radio box. Handle this case without
crashing too by checking for the pointer being valid before using it.
Also add a unit test checking that this works correctly.
See #22751.
(cherry picked from commit b0c417db36b7daca3b9b6731588f5b7b3f19ca6a)