Fix panic in validate context for build

Fixes #7611

Signed-off-by: Michael Crosby <michael@docker.com>
Shouldn't we check os.IsNotExist(err) somewhere here? Also what error we returns here?