How do I close the User Preferences window when it is not opened by the window manager?
You can open the preferences inside the existing blender window by setting the editor type in the header of any existing area:



As for why blender isn't getting a titlebar from the wm, I have no idea. It works fine for me here on openbox.