Fix corruption of fbrun-history
Fix corruption of fbrun-history

This commit fixes issues #72 (brought up + different solution by Mattias
Guns; I received a similar patch by 'Nable 80' via ML and discussed the
issue in #fluxbox with 'Nable 80'), patch #73 (Mattias Guns) and finally
patch #162 (Ulrich Eckhardt; this commit is heavily based upon Ulrich's
work).

The original code was overly complex. It tried to avoid writing
bytes to the disk at the expense of comprehensibility and as a result it
was buggy. I looked at both patches from Mattias and 'Nable 80' which address
the bug with skipping entries in the history-file (my fault: incorrect use
of outfile.ignore(1, '\n')): They provided a proper fix for the problem
but I decided to use Ulrich's code since it improves the whole code by making
it a lot simpler.

So, kudos to all of you.

lukoko/fluxbox,luebking/fluxbox,Arkq/fluxbox,naimdjon/fluxbox,naimdjon/fluxbox,luebking/fluxbox,olivergondza/fluxbox,lukoko/fluxbox,lukoko/fluxbox,naimdjon/fluxbox,olivergondza/fluxbox,olivergondza/fluxbox,naimdjon/fluxbox,luebking/fluxbox,Arkq/fluxbox,lukoko/fluxbox,Arkq/fluxbox,naimdjon/fluxbox,Arkq/fluxbox,Arkq/fluxbox,olivergondza/fluxbox,lukoko/fluxbox,olivergondza/fluxbox,luebking/fluxbox,luebking/fluxbox