If we fail in the middle of constructing lists of savefiles or remote
devices, free the entries we've already allocated.
Use separate variables for "current device" and "last device in the
list", to try to squelch some warnings.
We already rely on the pointer to the place where the device list
pointer should be put not being null; no need to handle the case where
it is null.