Removed unused variable
Use Poll.fileno() instead of saving the fd ourselves
Handle polling error gracefully

Signal both readability and writability so that the Python socket module
is able to retrieve the error