Removed goto statements in pkg

This patch replaces all occurences of the goto statement in the
Docker project (except in the `vendor` directory), replacing them
with `for` loops instead.

Closes #6332

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)

/cc @shykes @crosbymichael @rjnagal @vmarmol @vieux
Except for this one I think removing the goto's reduce readability and add a little complexity.  I don't want us to go on a war against all goto ever just because.