Rescue an IOError on channel double-close.

This was causing output from python meterpreter
commands run on OSX to be discarded when the error
was raised, making cmd_exec not-so-useful.
Adds a :vuln_test option to BES, just like in BAP.

I needed this to run a custom JS check for the Android
webview vuln when the exploit is served straight
through BES. The check already existed when using BAP,
so I tried to preserve that syntax, and also added a
:vuln_test_error as an optional error message.

This commit also does some mild refactoring of un-
useful behavior in BES.
Remove un-truthy doc string.
Use write() to fix SNMP on osx/freebsd.
Land #3933 - Fix cmd_exec with Python Meterpreter on OS X
Land #3934 - New :vuln_test option to BES
Land #3935 - Fix SNMP scanners on OS X/FreeBSD