GlusterFS: Synchronize operations that manipulate qcow2 data

Operations that modify qcow2 chains or the GlusterFS driver's
snapshot info file should use locking so that more than one thread
cannot run these operations at the same time.

Without this it is possible for multiple threads to concurrently
modify snapshot information resulting in an incomplete snapshot
chain.

Closes LP Bug: #1251425
Resolves: rhbz 1021966
Upstream-Havana: https://review.openstack.org/#/c/57943/
Upstream-Icehouse: https://review.openstack.org/#/c/56462/

Change-Id: I93c6ffecd9aec38560cb19085243390b9120b363
(cherry picked from commit 8a1fd8889170c289910944db016a4206fe5e1e32)