I agree that the count attribute appears to be broken.
I just reviewed the code in Template/Compiler/Tag/Foreach.php and it is
meant to work, but I can't get any life out of it.
Will file a bug in a moment.
Funnily enough, the first use of foreach in the conversation_list_macros template also uses an "if" expression to limit the matches. My PHP skills aren't good enough for me to figure out how the "if" works though - it certainly isn't explicitly handled in the Foreach.php code. (Ironically, the use of the expression in that particular template is redundant anyway
)