pkt: move parse_request() to continuation-passing style