Fix global methods not being deleted on change. Fixes T3117.

Summary: Fix global methods not being deleted on change.

Test Plan: The tests all pass. Also tested it by creating a scratchpad with a `var draw = ...` in it and changing it to `var drow = ...` and the draw loop stopped. Switching it back to `draw` started it working again.

Reviewers: pamela

Reviewed By: pamela

Subscribers: jlfwong, #cs

Maniphest Tasks: T3117

Differential Revision: http://phabricator.khanacademy.org/D12907