Override default `WM_QUERYENDSESSION` and `WM_ENDSESSION` handlers.