Fix invalid memory access in `gmx make_ndx` when using splitres/splitat
When new elements are added to indexGroups, it can reallocate,
moving (*indexGroups)[sel_nr].name
and thus invalidating
nameToSplit
pointer.
Could manifest in application crashes or garbled output data (for example, the output group names had empty prefix).
Closes #5050 (closed)
Edited by Andrey Alekseenko