tls: allow free(NULL) with DBG_QM_MALLOC enabled
(cherry picked from commit 99b049b1a04e3619e0aedde45a2209972e299d9c)