[CSTP] Moved finishing cleanup code to Cleanup().
[CSTP] Fixed segfault with erroneous replies.

Use a unique_ptr to safely destroy the object later.