improve trusted location detection

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

improve trusted location detection