Improve GC+Cairo workaround

Suggested by Eli Zaretskii (Bug#20890#31).
* src/font.h (font_data_structures_may_be_ill_formed): New function.
* src/ftfont.c (ftfont_close):
* src/ftcrfont.c (ftcrfont_close): Use it.

(cherry picked from commit d02fd482)
1 job for emacs-26 in 29 minutes and 48 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #459
test

00:29:48

 
Name Stage Failure
failed
test Test
Makefile:285: recipe for target 'check-doit' failed
make[2]: *** [check-doit] Error 1
make[2]: Leaving directory '/builds/emacs/emacs/test'
Makefile:255: recipe for target 'check' failed
make[1]: *** [check] Error 2
make[1]: Leaving directory '/builds/emacs/emacs/test'
Makefile:951: recipe for target 'check' failed
make: *** [check] Error 2
ERROR: Job failed: exit code 1