winpr: fixed problems Set/GetEnvironmentVariableEBA

* valgrind: fixed invalid read
* invalid or damaged environment blocked caused endless loop
* envblock created in SetEnvironmentVariableEBA lacked a trailing '\0'
  which could lead to a damaged environment block
winpr: add cwd support in CreateProcess*
winpr-env: extended GetSetEB ctest

Check if Get function only returns values for the exact variable name
winpr-env: fix in GetEnvironmentVariableEBA

GetEnvironmentVariableEBA didn't do exact matching of the requested variable name. If a variable
with similar but shorter name was set in the environment block it was returned.
For example if HOME was set in the environment block and HOMEX was requested the value of HOME was
returned.
winpr-env: fix in GetEnvironmentVariableEBA

* also fix cases where the provided env block is NULL
Merge pull request #1694 from bmiklautz/fix/winpr-env

winpr-environment fix and winpr-thread fix