Strip trailing whitespace on write for SQL files