ldb:sort: generalise both-NULL check to equality check