add proto validation at parse

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Merge pull request #6168 from vieux/add_proto_validation

add proto validation at parse