Hold the layer store lock while diffing
Hold the layer store lock while diffing

While generating a Diff, hold the lock on the layer store until after
we've completely finished building the diff.

There's an internal Mount/Unmount being done so that we can read the
layer's contents, and we don't update the mount counts properly if we're
not still holding the lock when the layer store's Unmount() method is
called, which doesn't happen until the ReadCloser that Diff() returns
gets closed.

Signed-off-by: Nalin Dahyabhai <f562fcb2a0b898bf0be1afc867ea92325d8f825f@redhat.com>

containers/storage,rhatdan/storage,containers/storage,containers/storage,rhatdan/storage,rhatdan/storage