Popup Menu Fix

Address the Problem in issue #94 where using a two finger
tap/press(right-click) on Multi-Touch touchpads and clickpads causes the toolbar
menu immediately unfocus. This was cause by the gdk.CURRENT_TIME. The
fix was to use the gtk.get_current_event_time() which was used in
the popup menu for the layers window.

This should fix #94
Merge pull request #128 from odysseywestra/popup_menu_fix

Popup Menu Fix
Fixed a few undefined variable errors

Somehow I missed a few in tests/test_memory_leak.py when I was
refactoring out `from numpy import *` for `import numpy`. Whoops.
Fixed an UnboundLocalError in lib/cache.py

Not much to say about this. I guess nobody's tried to index a LRUCache
recently.
Minor refactor in CurveWidget drawing

This was mostly done because flake8 was complaining a lot about how
previously variables were technically used before they existed. In
practice, this wouldn't happen, but I thought the code should have a
minor rework anyway.