Include exception in log in debug mode
Fix flake8 warning
Use a socket pair to trigger on callbacks instead of polling

This removes a wake up twice every second.