Refactor finalize swap handling
Refactor finalize swap handling

After a swap operation is finished trailer control flags are written
according to the type of swap that was performed. The function names
that execute those operations were renamed to explicity reflect what
they do, and all "less deterministic" behaviors, of the type
"if flash is not set, set it", were removed.

Signed-off-by: Fabio Utzig <66676b1ceaf93296e098708c09494361103aa635@apache.org>

tamban01/mcuboot,ATmobica/mcuboot,tamban01/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,tamban01/mcuboot,utzig/mcuboot,runtimeco/mcuboot,utzig/mcuboot,utzig/mcuboot,utzig/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,tamban01/mcuboot,utzig/mcuboot,tamban01/mcuboot