Eliminate duplication for _get_remaining_item_count function

Fix for Clone 4 in https://github.com/gnome-prototypes-team/gnome-music/issues/144