[debugger] Add locking around tls->frames usage/freeing (#6456)