QueryBasicTest. Wait for cluster safe state before running query

Issue #4200