Fix wrong debug message (bug #7547).

(cherry picked from commit 28649d37c3103a5879aaea3c8bd7a4eb30820dc9)
Do not write empty session files.

Unlink the session file if no windows have been saves.

(cherry picked from commit ddfeba132ff7d53acf93bc065d8e3902d440feda)
Some small optimizations in placement code.

Callgrind showed that the frameX/Y functions were called
a lot, so save the result inside the loop to do less calls.

Also inline the overlap functions, both are just simple calculations
so help the compiler a bit.

(cherry picked from commit e207a6bb16b5396544fa57e0b5cb5e621e8eaefb)
Small optimization in shadow loop.

Do some caclulations outside the loop or store them,
callgrind showed this loop was called _a lot_ and spend
most of the time in this part of the code.

(cherry picked from commit d4f2512d3826f745593a015a1699f9d867c030b8)
Autotools updates.

(cherry picked from commit 97d495593969d43f3d5b5fb26357c3e5a6d8ea71)
Updates for release.