Efficient solution of quadratically constrained quadratic subproblems within a direct-search algorithm