Fix #4156 - NoMethodError undefined method `stop'

This fixes: https://github.com/rapid7/metasploit-framework/issues/4156

To verify the bug, you can do:

- [ ] ```ruby -run -e httpd . -p 8181```
- [ ] Start msfconsole
- [ ] ```use use exploit/multi/http/struts_code_exec```
- [ ] ```set rhost [target]```
- [ ] ```set lhost [ip]```
- [ ] ```set rport 8181```
- [ ] ```set PAYLOAD windows/meterpreter/reverse_https```
- [ ] ```exploit```
- [ ] You should see "NoMethodError undefined method `stop' for nil:NilClass"

And then:

- [ ] Apply the patch, repeat the same steps. You should no longer see the error.