daemon: Fix statement order in erase() method

The previous code deletes a bundle first and then tries to use
the deleted reference to announce bundle events.