update usage of middleware

according to
http://fengmk2.cnpmjs.org/blog/2014/06/use-koa-csrf-high-performance-way.html