Remove `class << io ... end` since not threadsafe
Remove `class << io ... end` since not threadsafe

In MRI, defining singleton methods using `class << obj... def` is not
threadsafe. To work around this issue, use an alternative syntax that is
threadsafe: `def obj.method`.

This fixes a NoMethodError that would occasionally pop up in multithreaded
usage of net-ssh: NoMethodError: undefined method `recv' for #<IO:fd 47>.

delameko/net-ssh,dominics/net-ssh,causton81/net-ssh,zBMNForks/net-ssh,ccoenen/net-ssh,donv/net-ssh,TiagoCardoso1983/net-ssh,Eric-Guo/net-ssh,Teino1978-Corp/net-ssh,thechile/net-ssh,mfazekas/net-ssh,net-ssh/net-ssh,askl56/net-ssh