Autocomplete: allow promise object to be returned by source function

If the function passed as the 'source' option returns a promise, bind
result as a callback and handle failure automatically.