Fixing race condition

This is potentially a really bad one, would only show up extremely rarely and only during teardown.  Generally speaking, action should only be taken in response to a "true" return value of "expired".
Merge pull request #299 from leapmotion/fix-haslistenersrace

Fixing race condition