This has nothing to do with the joining vertices, this is the new code you added to load large textures for tilesets and the headless server code is not supposed to load graphics (liek textures). The new code added did not check for headless server mode and avoid loading the textures. This caused an assert to be thrown as you see in the stacktrace. I will fix this in svn for the new tileset code.