Refactor config dir check.
* bzrlib/tests/test_config.py:
(TestLockableConfig.create_config)
(TestLocationConfig.get_branch_config)
(TestBranchConfigItems.get_branch_config): Delete useless call.
* bzrlib/config.py:
(IniBasedConfig._write_config_file): Ensure the config dir exist.
(GlobalConfig._set_option, LocationConfig.set_user_option):
Delegate config dir check to _write_config_file.