Avoid unnecessary memory allocation.

Shared state must be closed when the last corresponding promise dies. Before i used a shared_ptr to special proxy object that closes the state in destructor. I needed only reference counter from shared_ptr and memory allocation was unnecessary. Now i have moved atomic counter of promises into the shared state.