[Task] Move TaskState enum to public headers.
[Error] Add AnyFailurePtr class, which is a specialized of ExceptionPtr.
[Task] Add TaskCore::WaitOrCatch().
[Task] (refactoring) Rename TaskCore::WaitOrCatch() to Catch().