weight/dlhweight.cc,weight/dphweight.cc: Avoid dividing by zero when
the collection size is 0.

git-svn-id: file:///home/xapian-svn/xapian/trunk@18311 6b2f1b92-a4f3-0310-943f-de3cbe41748b
api/query.cc,api/queryinternal.cc,api/smallvector.h,
include/xapian/query.h: Stop using a reference where we may end up
passing *NULL, as that's invalid.  Thanks Nick Lewycky and ubsan
for helping track this down.
tests/api_postingsource.cc: Fix testsuite to avoid passing literal
NULL - pass nullptr for C++11 and don't bother with that part of
the testcase for older C++.

git-svn-id: file:///home/xapian-svn/xapian/trunk@18312 6b2f1b92-a4f3-0310-943f-de3cbe41748b