Fixed non closing ftp.

This may have been the problem with crashing ftp upload.