Mark multiple messages as read in one query

…rather than in 2n queries, where n is the number of messages being marked as read.