Fix before-save-hook.

Only deletes trailing white space on modes derived from prog-mode.