api: avoid sigpipe for unruly api client