The right way to close the window is to not close the window.
The host deletes the window, not the plugin. If you delete it yourself, you’ll leave the host with a dangling window handle which could cause a crash, or at best just leave a black empty window.
Well, definitely do NOT delete it on a background thread. That will seriously fuck-up a lot of plugins, mostly because of win32 windows being owned by the thread that created them.
I can’t remember any other tips, but just do what the plugin host example does…