Preserve environment when forking child process

In some cases preserving environment can be crucial for tests to succeed so we
copy original environment and add FORK variable to it.