make read fd non-blocking and check for event type when polling
Fix deadlocks when running with mysql.

ViolationStore used to connect to the database before the process is forked and executed in catbox, so connection objects got duplicated. Two process try to use the same connection to update the database and mysql client library does not like it at all.
add comments
Merge pull request #139 from baris/bmetin_ameliorate_violation_store

violation collector:
* make read fd non-blocking and check for event type when polling
* fix deadlocks with mysql