filesystem: Fix a potential memory leak in an error handling path

It is possible to leave the loop in this function before visiting every
element in idle_data->entries, thus leaking the data in the remaining
elements. Tidy up the deallocation strategy to avoid the leak.

https://bugzilla.gnome.org/show_bug.cgi?id=710796