mysql_selector.c: introduce the myslq lock