Modified how to check if a chunk is already being uploaded

The new logic mirrors how the inventory functions, which solves the issue
that previously, a composite chunk already being stored by another daemon
was not recognised.  The new logic is also separate from how the digests of
stored chunks are calculated, and should be correct if the patch that makes
them the same as raw digests is reverted or modified.
Merge branch 'development' of https://github.com/NewsNow/brackup-nn into development