HUE-1908 [beeswax] Database of a saved query is not loaded back when opening it

Need specific logic for different states: query history, design, and execute query.
If query history or design, need to wait for databases and design/query to load.
Otherwise, just need to wait for databases to load.