Renamed all CPU_STATE_* defines for consistency and to avoid conflicts

Hello,

I have done some further renaming of the CPU_STATE_* defines to make the naming more consistent and to fix a further problem with CPU_STATE_IDLE. (f14ab93574956799debcc592d8f647cd0d5a632d wasn't enough).

This fixes #812 for me.

nick.