Implements Post::Common get_env and get_envs

I think this is required for https://github.com/rapid7/metasploit-framework/pull/2782. 

We shouldn't be using direct meterpreter calls in post modules, where possible, to try and maintain shell compatibility where possible.