Add timeout for query instance status.

Change-Id: Ia960ef45778d2548ae72b9aa45237c051c89d556
Merge "Add timeout for query instance status."