Fixed memoryleaks in MySQL driver due to not closing prepared statements and resultsets.