renderer/native: Refactor into secondary_gpu_get_next_dumb_buffer

Extract the next buffer -logic into a new function. This allows to
simplify copy_shared_framebuffer_cpu () making it more readable.

This change is a pure refactoring, no functional changes.

GNOME/mutter!593
4 jobs for !593 with mr/next-dumb in 6 minutes and 44 seconds (queued for 1 second)
detached
Status Job ID Name Coverage
  Review
passed #312193
check-commit-log

00:00:46

 
  Build
passed #312194
build-mutter

00:01:23

 
  Test
passed #312196
can-build-gnome-shell

00:04:33

passed #312195
test-mutter

00:02:23