Handle case of messages length being less than unreadcount
Handle case of messages length being less than unreadcount

this fixes #1561 by making sure that if the count is retrieved before the messages themselves, there is no error in the console.

LLK/scratch-www,LLK/scratch-www