monitor: Use qemu_get_cpu() in monitor_set_cpu()

No functional change, just a reduction of CPU loops.

The mon_cpu field is left untouched for now since changing that requires
a number of larger prerequisites, including cpu_synchronize_state() and
mon_get_cpu().

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu()

No functional change, just less usages of first_cpu and next_cpu fields.

env is passed to cpu_get_phys_page_debug(), which in turn passes it to
target-specific cpu_get_phys_page_debug(). Changing both would be a
larger refactoring, so defer that by using env_ptr.

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>