[PATCH v5 4/7] msvcrt: Factor out wenv_get_index helper.