I found it.
It works in a simple tescase like that
[ ] StartMySQL()
[ ] StopMySQL()
so it is a problem in my script. I printed out all the DB_ operation with their handles and discovered what I made two DB_connect with only 1 DB_disconnect, this is why the service didn't close.