Attempt to sync an UID in setChangeKey to avoid crashing

This may happen if between sync cache and setChangeKey a modSeq
is making synchroniseCache not retrieve the newly stored message.

This should fix the following crash:

https://tracker.zentyal.org/issues/2673
what would happen if `messageEntry` is `nil`?