Fix some bugs regarding debugging symbols (ozc -g)

1. ~~Added opcodes for `setSelf` and `getSelf`, previously missed~~. *Avoid generating `setSelf` and `getSelf` in some cases.* Now classes with locking can be compiled with `ozc -g`.
2. Using `{System.gcDo}` with debug entries may cause SEGFAULT due to accessing invalid pointers. The second commit should have fixed it.