Fixed some issues related to focusing:

 - If the focus operation fails, then the grab is restored correctly.
 - The layers are updated when the focus changes (since focused windows
   are stacked above other windows on their layer)
 - The border color is set correctly when the focus changes.
 - The border width is set correctly when a client is registered.