ldb: Fix search with scope ONE and small result sets
This changes the LDB behaviour in the combination of a SCOPE_ONE search and an index returning less than 10 results.
Included are many more tests for SCOPE_ONE and @IDXONE
indices which were not correctly tested previously.
Edited by Andrew Bartlett