Fixed write flag in filesystem locked write method