This patch to civimail.cronjob.php adds file locking to the delivery process, preventing more than one overlapping delivery from occurring which could otherwise result in duplicate email messages being sent.
The better fix would be a DB-side lock, whether per record or per mailing queue/job
is up to the implementors, but it would protect from other calling mechanisms,
such as roll-your-own cron jobs or calling the undocumented but sometimes
useful 'mailing/queue' function.