Fixes #4938: When `yii\db\ActiveQuery` is used to build sub-queries, its WHERE clause is not correctly generated