close input stream when sudo responder is done

for #311