misc.c->env.c split: Extract code

In the ongoing effort to reduce the number of loc in misc[12].c,
(see #209) this commit pulls a number of functions related to
reading, writing, and modifying environment variables from misc1.c
into a new module. This will later be merged in to os/env.c, but in an
effort to keep the diffs relatively sane because of the way the work was
orriginally done, this commit and the next 2 will operate on a new file
which will then be merged in to os/env.c
misc.c->env.c split: Fix lint errors and warnings

 - add explicit size_t cast
   - silences an unsigned -> signed conversion warning
 - remove trailing whitespace
 - convert tabs to spaces
misc.c->env.c split: Documentation

[ci skip]
misc.c->env.c split: move environment.c code ...

to env.c
This is the last step in this PR, which removes environment.c and
squashes all its code into os/env.c