Fix resource leaking when loading fonts