[minor] Use lexical-scope to detect leaked globals