Fix hangs and segfaults when the FFT is moved around and zoomed

Moving the FFT plot off the screen caused a hang or a segfault. Making
the window too large caused segfaults because MAX_SCREENSIZE and
HORZ_DIVS_MAX were not taken into account. The zoom could also become
negative or get stuck on max.