Improve inline directives for templater context
### Search before asking

- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.


### Description

I cannot alter jinja context in inline fashion.

Good:

```
[sqlfluff:templater:jinja:context]
my_inline_dict={"k1": "v1", "k2": "v2"}
```

SQL:
```sql
{% for k in my_inline_dict %}
SELECT {{ k }};
{% endfor %}
```

sqlfluff render:
```sql
SELECT k1;

SELECT k2;
```

Bad:
```sql
-- sqlfluff:templater:jinja:context:my_inline_dict:{"k1": "v1", "k2": "v2"}
{% for k in my_inline_dict %}
SELECT {{ k }};
{% endfor %}
```

sqlfluff render:
```
Traceback (most recent call last):
  File "/home/lrogalski/repo/REDACTED/.venv/bin/sqlfluff", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/sqlfluff/cli/commands.py", line 1451, in render
    raw_sql, file_config, _ = lnt.load_raw_file_and_config(path, lnt.config)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/sqlfluff/core/linter/linter.py", line 147, in load_raw_file_and_config
    file_config.process_raw_file_for_config(raw_file, fname)
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/sqlfluff/core/config.py", line 1164, in process_raw_file_for_config
    self.process_inline_config(raw_line, fname)
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/sqlfluff/core/config.py", line 1150, in process_inline_config
    self.set_value(*config_val)
  File "/home/lrogalski/repo/REDACTED/.venv/lib/python3.11/site-packages/sqlfluff/core/config.py", line 1094, in set_value
    dict_buff.append(dict_buff[-1].get(elem, {}))
                     ^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
```

3.2.4

### Use case

I want to have "local" jinja context in my sql to:
- improve readability
- avoid always-growing and self-conflicting context in .sqlfluff file

### Dialect

ansi

### Are you willing to work on and submit a PR to address the issue?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)