Added lock for buffer size

waiting for the buffer size to change now utilizes that lock instead of
reader/writer