Be more careful when referencing glyphs in a sparse bitmap font.

Try bounding indices in bdf->glyphs by bdf->glyphcnt in order to avoid crashes.

This may address issue #1603.