nmconfig: add function for freeing a nmdevice