HUE-1883 [beeswax] Query with expired result will break the editor

Add Javascript to handle the errors.
Also expire queries.