Fix crash while reading livestatus query.

Refs #5316