make res.charset also work before res.type

provide more friendly usage for res.charset
not longer need to put res.charset after res.type

```
res.charset = 'gbk';
res.type = 'text/html';

res.charset = 'gbk';
res.body = '<html></html>';

res.charset = 'gbk';
res.body = {foo: 'bar'}
```