Use $outbufflen instead of $outleft
Handle premature exit via SIGINT