Use UID compression on large mailbox message lists when serializing

For large mailboxes with highly compressible lists (think mailboxes with
sequential saves and infrequent deletes, like Sent/Trash/Spam etc.) the
savings are dramatic.

For my Trash mailbox (9000 messages) storage size in the session was
reduced from 48KB to 400 bytes
Correctly cache mailbox icon hook data
This is slightly faster
Save 2 ini_set() calls on each page if using a recent version of PHP
Faster PHP version checking