remove obsolete new lines at the end of a file