The read file task reads the entire file in to memory, accessible via the previous task STDOUT (at least that's the way it makes sense to me). Think of it like reading the entire file as a giant multi-line text blob.
The next task then should be a set job variable task, where you use a regular expression to set the value. As long as only one line has the pattern you seek, this should do it as the regex will look at the entire output from the read file at once (remember, it's a giant multi-line text field really):
{REGEX(Replace|{TASK(PrevTask,StdOut)}|(.*\s)*total.messages.dead = (\d*)(.*\s)*.*$|$2)}
The regex says to search through the previous task's StdOut (the entire file contents) for zero or more groups of characters followed by whitespace (lines ending with carriage return/linefeeds), followed by "total.messages.dead = ", followed by a captured group (in parens) of zero or more digits (the value we want to keep), followed by zero or more groups of characters followed by whitespace (lines ending with carriage return/linefeeds), followed by zero or more characters until the end of the file is reached. Then that string is replaced by the contents of the second captured group, referenced by the "$2".
So using your example data, the job variable will end up with a value of '5'.