fix crash in string_input_win

handle case of empty history and already entered text (which adds to the displayed history) correctly