The new function looks like the previous one except that it operates at the stream interface level and assumes an already closed SI. Also remove some old unused occurrences of srv_close_with_err().