throw an error on empty string env variables on Win32

Setting an env var to empty string on Win32 deletes it, so they should throw an error. This patch implements that and adapts the tests accordingly.