Improve code()/message() initialization and error handling in Net::Cmd

Amongst other things, this fixes a problem of obsolete error codes being
returned after connection failure.

Patch by Tom Metro <tmetro@cpan.org> on CPAN RT#14875 with minor changes
by the committer to apply the patch to the current source.
Fix a warning introduced by the previous commit

"Use of uninitialized value in join or string at lib/Net/Cmd.pm line 158."