bash: simple reimplementation of _get_comp_words_by_ref