fixes #1419 with last xhr check and request delay

Fixes #1419.

This pr adds a `lastXhr` object which stores the last ajax request which it uses to check against the incoming responses.

It also increases the autocomplete request delay to 500 ms from the default 300 ms to reduce the number of responses.