Afaict, the "Unknown error" simply means that a connection with the FTP server at $ftp_addr could not be made. For example I can generate that error by setting $ftp_addr to 127.0.0.1 (there's no ftp server running on this box), or by setting it to 192.168.0.8 (which doesn't exist on my local network).
Could it be that a firewall that's configured to allow the "other ftp client applications" to work has