[12771] Rewrite rest management.

Fix Rest when logged in not working in some case.
Also fix rest bonus according to wowwiki.

This need to be backported in all core.
Thank to @TheTrueAnimal for pointing.
Fix cmangos/issues#494