Another option is running your CSV file creation logic before you will attempt to read the lines.
I am not able to store it in memory, cause I use this CSV file in another tests for logging into application. I will try Critical section controller. And maybe I can rewrite it into Groovy as well.
The third (and IMHO) the best solution is getting rid of the file, write everything into JMeter Variable(s) or properties and read the values from memory when required. I would also recommend considering switching to JSR223 PostProcessor and Groovy language as for your scenario Groovy will provide much better performance than you can achieve using Beanshell, see Groovy Is the New Black article for details.
Your test seems to be badly designed, concurrent writing into the same file is not something recommended, you should have ReadWriteLock implementation or use JMeter's Critical Section Controller to ensure that only one thread is writing something into the file at a time.