Tweaked callbacks to prevent race condition

It doesn't appear to cause any new problems. I'm assuming it's safe to continue executing the callback even after the finalize callback was executed, though I'm not 100% positive. Any verification on this would help.

https://github.com/libevent/libevent/issues/104