Decouple DatabaseBlock::newFromTarget from DatabaseBlock::newLoad
Before this, DatabaseBlock:newFromTarget initialises a new block and
calls DatabaseBlock::newLoad on that instance, passing through the
target and type via that instance. However, newLoad returns a brand
new block instance. This patch makes newLoad into a static method,
with the target and type passed as method parameters.
It also separates the block-choosing logic in newLoad into a separate
method, DatabaseBlock::chooseMostSpecificBlock. Doing this (1) makes
it more transparent that Block uses two different ways to choose a
block (see also Block::chooseBlock), and (2) makes it possible to
re-use newLoad to get multiple blocks.
Also, filter out any duplicate autoblocks that are found by newLoad.
Bug: T206163
Change-Id: Iefa3aaadf2954c3b86f5c691096af31de40fae6c