removed duplicate code
fixed some leaks when mysql_close will be called before all stmts are freed.
Fixed compile warnings.
Missing portion of the previous patch.
fixed a bug in prepare/bind
initial upload
12345678910