Executes block and invokes onFailure if it throws. Rethrows CancellationException after calling onFailure so structured concurrency is preserved.