Fix #550 Ensure to send response header before finishing read document body

Ensure to send response header before call finish() method after finish reading document body. This is for do_PUT and do_POST router handler.