scope.c: fix compiler warnings for cast (const char*) to (void *)
scope.c: fix segfault when ScopeDelete() calls the second item

At the first glance the algorithm seemed wrong. It took me, however, a
while to understand /how/ wrong it was.

See, if 'scope' is neither the first, nor the second item in the VSCOPE
list, then both 'if's will pass (not removing it from the list, that is),
scope will be free()d and loop will break; . VSCOPE will then be corrupt.
Even without the "break;" statement, the scope would be double-freed.