rewrite Str.quote not to warn on 4.02

use Buffer.t for a buffer instead of a mutable string.