THD:: cleanup() must be where it used to
THD:: cleanup() must be where it used to

between net_end() and ha_close_connection()

this fixes lockups in main.locked_temporary-5955 and some
other innodb tests.

natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2