retry to retrieve metadata on failure during pull

This PR is a backport of PR #4387 for the bump_v0.9.1.

This makes Docker retry to retrieve the JSON metadata for the layers. Docker will make 5 attempts to retrieve the metadata before failing and it will increase the delay between attempts after each failed attempt.