Don't allow unallocated indexes to be closed.

Refuse to close indexes that have not had their primary shard shard allocated post api action because this leaves the index in an un-openable state.

Closes #3313