core: More reliable way to wait for idle handlers
core: More reliable way to wait for idle handlers

Instead of keeping the ID of the last installed idle handler and then
removing it at the end, just add a new idle hander to end the response so
the response is ended after all the idle handlers have been called. This
fixes the issue of LiveResponse not sending all the bytes to the client
before closing the socket on EOS.

GNOME/rygel,Pelagicore/Media-Manager-Rygel-patched,GNOME/rygel,jku/rygel,Pelagicore/Media-Manager-Rygel-patched,Pelagicore/Media-Manager-Rygel-patched,luisbg/rygel,jku/rygel,Tarnyko/rygel,GNOME/rygel,Tarnyko/rygel