Fix possible crash during delivery delay

This is reproducible in conversations with many messages
(e.g. 7800 messages on SGS3).

Change-Id: I26a7b989c9d27da34481f20f358a9e09bb4a2ef6
(cherry picked from commit db4812c76c04faf5760541029ceb9633a0ee3af3)
Automatic translation import

Change-Id: I3d33a50b6ec23a46367419d4491374b02d22393d
(cherry picked from commit 7277a58681fe5444bef336e88df7e8816874be52)