Improve robustness of shared font dumping

This should fix the crashes everyone was experiencing.