HistoryKeeper::getChatHistory(..): fix in sql statement

Tested 6dd2293 on client only with one contact and missed this bug: (mixing all messages together on history fetching).