Free csp resources in the thread that belongs to the csp