Clean timeout handling code

Hi @Zinterax, this pull requests tries to clean the timeout handling code in https://github.com/rapid7/metasploit-framework/pull/3238, I've not landed by myself, because this module has had a lot of modifications these last days, and you were currently handling pull request with @wvu-r7 and @Firefart, so maybe I'm not aware of something about this pull request, so sending to you pull request, if there aren't stoppers, please feel free to land it, so https://github.com/rapid7/metasploit-framework/pull/3238 will be automatically updated and hopefully ready to go!