in reply to
Net::OpenSSH - page not loading completely
You might want to use lsof to figure out what open file handle is keeping the respective webserver process from considering the CGI call done. Apache, for example, would wait for all stdout/stderr handles (i.e. of the CGI itself and any children the CGI forked) to be closed.
You probably also need to point default_stderr_fh to /dev/null (or simply set master_stdout_discard => 1, master_stderr_discard => 1), but that's just a guess (i.e. untested).