Fix an error in the qp_test.c unit test
In order to check whether there are enough inserted values the code uses the 'tests' variable (loop counter), which is unreliable, because the loop sometimes removes an item instead of inserting one (when the randomly generated item already exists).
Instead of the loop counter, use the existing variable 'inserted', which should indicate the correct number of the inserted items.
Closes #4375 (closed)