Issue 9148 - 'pure' is broken

https://issues.dlang.org/show_bug.cgi?id=9148

A nested function inside `pure` function should also be typed as `pure`, and considered as weak purity function.
The _scope_ of a static variable is completely unimportant. As long as a pure function does not _access_ a mutable static variable, then everything is fine. Also, besides being called, an impure nested function can be passed around as a value. The following code is fine:

```d
int delegate() getCounterIncrementor()pure{
    static int counter = 0;
    return ()=>counter++;
}
```
`getCounterIncrementor` does not access any mutable static variables, hence it can be pure. The following must be (and is already) illegal though:
```d
int foo()pure{
    return getCounterIncrementor()();
}
```
I.e. there are already enough type checks to make sure that static variables are never accessed within a `pure` function. Computing using impure functions is not impure as long as those functions are not called. A function that composes two non-`pure` functions, for example, is still a `pure` function.