[PATCH 5/9] tools: split off common helpers for host validate tool