pkg: *: removed goto statements

This patch replaces all occurences of the goto statement in the
Docker project (except in the `vendor` directory), replacing them
with for loops instead.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)