Delete shards only after making sure no has a reference to it.

* shard_datastore.go(Deleteshard): Check the reference count of the
  shard and mark it for deletion if there are still more references out
  there. Otherwise, delete the shard immediately. Also refactor the
  deletion code in deleteShard(), see below.
* shard_datastore.go(ReturnShard): Check to see if the shard is marked
  for deletion.
* shard_datastore.go(deleteShard): Refactor the code that used to be in
  Deleteshard in its own method. Use `closeShard` instead of doing the
  cleanup ourselves.
Merge pull request #985 from influxdb/fix-985

client.WriteSeries returns: Server returned (400):  IO error: /opt/influxdb/shared/data/db/shard_db_v2/00190/MANIFEST-000006: No such file or directory