The problem seems to be outline in
http://perlmonks.org/?node_id=632731:
as you say, in DESTROY we destroy the object in each thread, which
results in multiple releases which understandably makes the library very
grumpy.
I don't like the idea of having to manually keep track of a threaded
reference count (by tracking CLONE or using threads::shared::refcnt),
since neither method is especially reliable (see e.g.
http://www.nntp.perl.org/group/perl.ithreads/2007/08/msg1197.html).
For now I'm going to have to recommend you declare the Net::SSH2 objects
as shared, rather than thread-local, until a better solution exists.