Using the set function for lastKeycode everywhere

And using keycode 2 as that is more the expected
behaviour when locking the session: always stop
music.
Only stop music on session lock

WTSSESSION_CHANGE is an event which is fired
for many different types of events, including
session lock. With this change the music is only
paused for session lock, and not for any other
events (e.g. session unlock).