Fix: prevent server crash if accessing an empty gist

Defensive check for gists with no history.

It is possible to have a gist with no history. This should
prevent the server from going down if such a gist is
accessed.

PS: Sorry I crashed bl.ocks.org! Nice to see it gets restarted pretty quickly.