There does not seem to be a general rule for whether a plural or singular is used in a "They wrote in their diary/diaries" type situation but in general the plural seems to be preferred. There are also times when one or the other is strictly necessary.
From what I gather the answer to this question is very far from straightforward. I would recommend reading the language log posts by Mark Lieberman here and here. For the sake of having a less comprehensive but somewhat shorter exposition the rest of this post will mostly be an attempt at a summary.
In the posts Mark looks at a very similar sentence "Ostriches [...] bury their head in the sand" and asks whether this is the correct usage. To him this suggests that the ostriches have one collective head they bury (maybe a shrunk lions head talisman or the Head Ostrich).
Research then shows and I quote:
What [we] learn is that the distributed meaning of the plural "their heads" — one per individual — is sanctioned by the habitual usage of many esteemed writers. The singular version "their head" has two interpretations, one that is semantically singular (meaning "their leader" or the like), and one where again there are many heads, distributed one per individual. In the distributed meaning, where each individual has a unique and individual head, the plural heads is substantially more common than the singular head; use of the singular is roughly equally divided between its two meanings.
He further elaborates on this in the next post looking at a rule proposed by judge Posner regarding when the plural and when the singular form is used again I'm quoting, this time judge Posner:
The "virgins of Jerusalem hang down their heads" sounds fine, but so does "In prosperous days They swarm, but in adverse withdraw their head." The difference is that the virgins are acting collectively, in unison; the swarmers are not–nor are the ostriches when they bury their heads.
Mark concludes that this rule doesn't hold water, at least in the categorical sense though he points out he doesn't have the evidence to conclude anything about statistics.
I finish with one more quote from Mark
But more generally, it seems to me, this is a useful example of the natural desire to find a logical basis for choice, in cases where our intuitions are complex and variable, and our actions are even more so. An enterprise of this kind usually forces us to invoke or discover a large number of factors that turn out to be relevant; and in this case, it's easy to think of several relevant factors that we aren't taking into account.
But(sic) the end, linguistic choices are often as difficult to reduce to simple principles as other social actions are. This is especially true when specific choices bring general principles into conflict, as is arguably the case here.
I will point out that this is written from a descriptivist point of view. That is Mark Lieberman is a descriptivist and so when confronted with a question about a point of grammar he attempts to use research on how english is used to determine the answer.