Rewrite comint-clear-buffer as emacswiki says.