dump: Abstract dump_init() with cpu_synchronize_all_states()

Instead of calling cpu_synchronize_state() for each CPU, call the
existing cpu_synchronize_all_states() helper.

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
memory_mapping: Improve qemu_get_guest_memory_mapping() error reporting

Pass any Error out into dump_init() and have it actually stop on errors.
Whether it is unsupported on a certain CPU can be checked by looking for
a NULL CPUClass::get_memory_mapping field.

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
[AF: Reverted changes to CPU loops]
Signed-off-by: Andreas Färber <afaerber@suse.de>