refactor disconnectFromFtp to remove cached entries when necessary

In cases where a cached ftp connection fails to connect, or a file
transfer has failed, we should removed the cached connection. Since qnam
has an idea of a single internal QFtp per full operation, when file
transfers failed previously the cached connection would be reused for
subsequent connections and thus fail.

[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
properly handles FTP transfer failures by removing failed cached ftp
connections.

Task-number: QTBUG-40797
(cherry picked and adapted from qtbase/45cbbe56bc13216b83215ea148590eccf81f420a)
Change-Id: Ie9eec5ec54af16a8d19e34d04bdd993cc7bbd0f5
Reviewed-by: Richard J. Moore <rich@kde.org>
Mac Style: Fix QLineEdit frame in 10.10

Also removes some dead code.

Backport of 83f06da1c6bffff61af78cbe75a0691d53742b53 from qt5/qtbase

Change-Id: I7e088ca8b52bc3e2da25e29ab570469eab6f97bf
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>