MariaDB: use the builtin global object instead of raw pthread_key_t

Signed-off-by: swpd <swpdtz@gmail.com>