frontend/history.c: Prevent possible null dereference of hist