cmd/dockerd: validate API configuration as part of --validate
cmd/dockerd: validate API configuration as part of --validate

Previously, the API server configuration would be initialized and
validated when starting the API. Because of this, invalid configuration
(e.g. missing or invalid TLS certificates) would not be detected
when using `dockerd --validate`.

This patch moves creation of the validation earlier, so that it's
validated as part of `dockerd --validate`.

Signed-off-by: Sebastiaan van Stijn <64b2b6d12bfe4baae7dad3d018f8cbf6b0e7a044@gone.nl>

jimjag/docker,moul/docker,Ramzec/docker,Ramzec/docker,nawawi/docker,moul/docker,mahak/docker,moby/moby,mahak/docker,jimjag/docker,flavio/docker,flavio/docker,Mokolea/docker,cpuguy83/docker,nawawi/docker,Mokolea/docker,mahak/docker,cpuguy83/docker,konstruktoid/docker-upstream,nawawi/docker,Ramzec/docker,cpuguy83/docker,konstruktoid/docker-upstream,Mokolea/docker,trebonian/docker,vdemeester/docker,thaJeztah/docker,flavio/docker,konstruktoid/docker-upstream,thaJeztah/docker,thaJeztah/docker,nawawi/docker,Mokolea/docker,mahak/docker,jimjag/docker,trebonian/docker,konstruktoid/docker-upstream,vdemeester/docker,moul/docker,cpuguy83/docker,moby/moby,thaJeztah/docker,jimjag/docker,trebonian/docker,moby/moby,trebonian/docker,moby/moby,flavio/docker,Ramzec/docker,moul/docker,vdemeester/docker