tls_wrap: fix interleaving in InvokeQueued

WriteItem callback may add new item to the `pending_write_items`. Ensure
that this item won't be called in the same `InvokeQueued` call, as it
may result in way-to-early `finish` event on js-side.

fix #7733