should close reader thread correctly