[PATCH 05/20] binman: Move problem-checking code into a function