Improved java.net.Authenticator cleanup and workaround for https://issues.apache.org/jira/browse/CXF-5442