Fixes asynchronous autocompleter prefix updating

Before it could happen (if an async autocompleter returned late) that the prefix used in the autocomplete was out of date. This fixes that by recalculating the prefix again once the results returned. Not super efficient, but at least correct.