Fix for iOS 5: Fix for multiple messages sent to one device after app reinstall.

With CFUUIDCreate you may get the same token from a new UUID after a reinstall. You can end up with multiple entries for the same app, all with the same valid token. Database changes:

CREATE UNIQUE INDEX `app_token` on apns_devices (`appname`,`devicetoken`);
With this change, if a new UID is generated but the token is unchanged, update the uid in the database:
  ON DUPLICATE KEY UPDATE `deviceuid`='{$deviceuid}',