Since no one has answered you yet, I'll throw this out. To exec a program in the background with SSH2 on linux, we use this to close off the file numbers of the process being backgrounded. I think it is important to do that, just as if it were a daemon.
my $chan = $ssh2->channel();
$chan->exec("nohup /home/zentara/perlplay/net/zzsleep > foo.out 2> foo
+.err < /dev/null &");
I know the SSH2 libs are not what you are using, but it might help for you to see a correctly setup nohup string.