Whoops, forgot to bracket the calls for TLS shutdown with a #ifdef TLS_SUPPORT