reverted some code to original.

the tests actually told me what the real problem was:
  when you create a new MySQLi it sets some m_ variables,
  ext_mysqli was setting them to nullptr so i set them in connect() if they were empty
  reset the connection in the mysqli object to the one returned from mysql_comon