Clearing the status bar in the proper way

For the past 10 years the status bar has been cleared by printing spaces
over its previous contents. This commit tries to add more sanity where
it is definitely needed.