Fix fit-frame-to-buffer for multi-monitor setup

* lisp/window.el (fit-frame-to-buffer): Call
'frame-monitor-attributes' instead of
'display-monitor-attributes-list'.  Fix geometry calculations for
multiple monitors.

Copyright-paperwork-exempt: yes
1 job for emacs-27 in 62 minutes and 34 seconds (queued for 2 seconds)
Status Job ID Name Coverage
failed #5124


Name Stage Failure
test-all Test
make[2]: *** [check-doit] Error 2
Makefile:319: recipe for target 'check-doit' failed
make[2]: Leaving directory '/builds/emacs/emacs/test'
Makefile:294: recipe for target 'check-expensive' failed
make[1]: *** [check-expensive] Error 2
make[1]: Leaving directory '/builds/emacs/emacs/test'
make: *** [check-expensive] Error 2
Makefile:959: recipe for target 'check-expensive' failed
ERROR: Job failed: exit code 1