Check if topmsg was initialized before accessing it.

Without this, Hercules reproducibly fails to start when you type in
a command before the text UI is up, crashing in do_panel_command.

Index: hercules-3.12/panel.c
===================================================================
--- hercules-3.12.orig/panel.c
+++ hercules-3.12/panel.c
@@ -508,6 +508,11 @@ static PANMSG* newest_msg()
 
 static int lines_scrolled()
 {
+    /* topmsg is not yet initialized when the text UI is not shown yet,
+     * but this function is still called if a command has been entered
+     * before that. */
+    if (!topmsg)
+        return 0;
     /* return # of lines 'up' from current line that we're scrolled. */
     if (topmsg->msgnum <= curmsg->msgnum)
         return curmsg->msgnum - topmsg->msgnum;
