[Concept] [PATCH 07/12] buildman: Extract target checking from scan() into _check_targets()