server: close device endpoints on shutdown