registry/session: fix panic in GetRemoteImageLayer

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Merge pull request #7864 from unclejack/fix_panic_registry_session

registry/session: fix panic in GetRemoteImageLayer