Fix on_session_module_run bug

Should fix the bug catched by @wvu-r7 on https://github.com/rapid7/metasploit-framework/pull/2952, still any direct access to framework.sessions should be reviewed! This pull request is highly sensible!