I don't recall GLUT being able to close windows independently in the same thread, like that. As you only use a single glutMainLoop()
call to get them going, thereby when the main loop is killed for one window, it's killed for all of them.
You could try creating the windows in their own Thread. That might work, but I'm not entirely sure.
Something else you could try, is to use GLFW instead, using GLFW, you need to create the main loop etc, yourself. Bottom line, that's much easier to use and it gives you a lot more control, over your OpenGL programs. Also if you don't already have it, you should get something like GLEW.