Refactor write buffer mechanism and optimize stats tracking
Removed TasksQueue and simplified buffer swap logic for thread safety. Introduced more granular statistics for write operations. Adjusted test cases to validate the changes and efficiency of the new implementation.