Add socket shutdown to prevent bridge from crashing on connection reset.