FunctionScore: Fixed RandomScoreFunction to guard against _uid field not existing.

Also added a test case to check the random score works with queries on
an empty index.