Fixed issue #7787: Error "Cannot execute queries while other unbuffered queries are active" on function "Get statistics"