Removes trailing newlines from files