Refactoring std os setenv

Hello!

After talking with @huon on Irc and trying different thing, I purpose to add a error handling over this wrapper of libc::setenv for catching errors.

I will need some help on the two commit marked as `fixup!`. I am still a newbie to rust. :)