break reference loop using weakref to prevent memory-leaking

This patch should fix memory-leaking issue noplay/python-mysql-replication#57