Closing readers and writers