[CORE] Intorduce shards level locks to prevent concurrent shard modifications

Today it's possible that the data directory for a single shard is used by more than on
IndexShard->Store instances. While one shard is already closed but has a concurrent recovery
running and a new shard is creating it's engine files can conflict and data can potentially
be lost. We also remove shards data without checking if there are still users of the files
or if files are still open which can cause pending writes / flushes or the delete operation
to fail. If the latter is the case the index might be treated as a dangeling index and is brought
back to life at a later point in time.

This commit introduces a shard level lock that prevents modifications to the shard data
while it's still in use. Locks are created per shard and maintined in NodeEnvironment.java.
In contrast to most java concurrency primitives those locks are not reentrant.

This commit also adds infrastructure that checks if all shard locks are released after tests.

Conflicts:
	src/main/java/org/elasticsearch/common/io/FileSystemUtils.java
	src/main/java/org/elasticsearch/gateway/local/state/meta/LocalGatewayMetaState.java
	src/main/java/org/elasticsearch/gateway/none/NoneGateway.java
	src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java
	src/main/java/org/elasticsearch/index/service/InternalIndexService.java
	src/main/java/org/elasticsearch/index/store/DirectoryService.java
	src/main/java/org/elasticsearch/index/store/DistributorDirectory.java
	src/main/java/org/elasticsearch/index/store/Store.java
	src/main/java/org/elasticsearch/index/store/fs/FsIndexStore.java
	src/main/java/org/elasticsearch/indices/store/IndicesStore.java
	src/test/java/org/elasticsearch/index/store/DistributorDirectoryTest.java
	src/test/java/org/elasticsearch/test/InternalTestCluster.java
	src/test/java/org/elasticsearch/test/store/MockFSDirectoryService.java
Fix synchronization - leftover from refactoring