fix for "no environment computed" bug

I found this bug while trying to fix bug #581 but it's different. In the example below, the error is cause by the bar() call in baz, because it's not seen as a closure by the compiler.

```
proc foo(x: int, y: int) =
  proc bar =
    echo x

  proc baz =
    bar()

  bar()
  baz()

foo(314, 918)
```

The error message is
```
bug581_3.nim(10, 4) Error: internal error: no environment computed
No stack traceback available
```

This patch fixes the bug by getting the environment dependencies found in proc bar, and creating a copy of those dependencies for proc baz.

PS: sorry about the patch, my editor removes trailing spaces.