Build and segfault fix on gentoo

The gentoo ebuild which builds from the git sources performs an out of tree build. The common/include/svnrev.h file was generated in the build directory in that case.

A segfault on boot cd is fixed be adding an extra check for a 0 window ID.