cpp/thread/promise/~promise

Abandons the shared state:
 * if the shared state is ready, releases it.
 * if the shared state is not ready, stores an exception object of type std with an error condition std, makes the shared state ready and releases it.