Clean up buffer thread