Ahaggar: create a new function populate_hash_target()

Move the logic of target functions check/creation to its own new
function.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>