test: end querystream on API error