Fix segmentation fault with gdk_monitor_get_model (Bug#35259)

* src/frame.c (free_monitors): Check if NULL before freeing.

* src/xfns.c: (x-display-monitor-attributes-list): Check if NULL
before copying.
1 job for master in 60 minutes and 1 second (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #1344
test-all

01:00:01

 
Name Stage Failure
failed
test-all Test The script exceeded the maximum execution time set for the job
  GEN      lisp/international/ccl-tests.log
ELC lisp/international/mule-tests.elc
GEN lisp/international/mule-tests.log
ELC lisp/international/mule-util-tests.elc
GEN lisp/international/mule-util-tests.log
ELC lisp/international/ucs-normalize-tests.elc
GEN lisp/international/ucs-normalize-tests.log
Pulling docker image gitlab/gitlab-runner-helper:x86_64-f100a208 ...
ERROR: Job failed: execution took longer than 1h0m0s seconds