An updated patch with some fixes for bugs reported earlier,
A. failover_to_new_master_v4.patch
Default value "any" is added to target_server_type parameter during its definition.
B. libpq-failover-smallbugs_02.patch
Fixed the issue raised by [PATCH] pgpassfile connection option, Now added host and port name along with pgpass file error message when ever authentication fails and added same to file libpq-failover-smallbugs.patch (bugs reported and fixed by Tsunakawa). I did review of original bugs reported and fixes it seems okay for me. I could not test GSS and SSPI authentication as it appears they needed windows.