Fix deadlock in the inmemory storage driver
Fix deadlock in the inmemory storage driver

According golang documentation [1]: no goroutine should expect to be
able to acquire a read lock until the initial read lock is released.

[1] https://golang.org/pkg/sync/#RWMutex

Signed-off-by: Gladkov Alexey <c3a6b77263aa5673e69e156017f6482a5bd90458@redhat.com>

sergeyfd/distribution,yuwaMSFT2/distribution,dmcgowan/distribution,mikebrow/distribution,sergeyfd/distribution,jwhonce/distribution,sadlil/distribution,thaJeztah/distribution,estesp/distribution,mikebrow/distribution,docker/distribution,jwhonce/distribution,yuwaMSFT2/distribution,sadlil/distribution,thaJeztah/distribution,dmcgowan/distribution,estesp/distribution,docker/distribution