### Summary

The password lookup rewrites the password file with the same content if the `encrypt` option is used. This happens on every invocation, not only if the `salt` or `ident` values are added to the file.

This bug was introduced in commit 1bd7dcf339d and is caused by this code in `lib/ansible/plugins/lookup/password.py`:
```
            ident = params['ident']
            if encrypt and not ident:
                changed = True
                try:
                    ident = BaseHash.algorithms[encrypt].implicit_ident
                except KeyError:
                    ident = None
```

While this bug seems minor as only the file modification time is changed and the actual file contents remain the same, it's quite annoying if the files are stored on an encrypted overlay filesystem like encfs as there the encrypted file content changes. It also confuses backup and sync tools which monitor the modification time.

### Issue Type

Bug Report

### Component Name

password

### Ansible Version

```console
$ ansible --version
ansible [core 2.15.0.dev0] (devel 1bda6750f5) last updated 2022/11/21 15:47:49 (GMT +200)
  config file = /home/gaudenz/.ansible.cfg
  configured module search path = ['/home/gaudenz/.ansible/plugins/library']
  ansible python module location = /home/gaudenz/projects/ansible/ansible-core/lib/ansible
  ansible collection location = /home/gaudenz/projects/ansible/ansible-core/collections:/usr/share/ansible/collections
  executable location = /home/gaudenz/projects/ansible/ansible-core/bin/ansible
  python version = 3.10.8 (main, Nov  4 2022, 09:21:25) [GCC 12.2.0] (/usr/bin/python)
  jinja version = 3.0.3
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
ANSIBLE_HOME(env: ANSIBLE_HOME) = /home/gaudenz/projects/ansible/ansible-core
CONFIG_FILE() = /home/gaudenz/.ansible.cfg
DEFAULT_MODULE_PATH(/home/gaudenz/.ansible.cfg) = ['/home/gaudenz/.ansible/plugins/library']
DEFAULT_ROLES_PATH(/home/gaudenz/.ansible.cfg) = ['/home/gaudenz/.ansible/roles']
DEFAULT_TRANSPORT(/home/gaudenz/.ansible.cfg) = ssh
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(/home/gaudenz/.ansible.cfg) = False

CONNECTION:
==========

paramiko_ssh:
____________
host_key_checking(/home/gaudenz/.ansible.cfg) = False

ssh:
___
host_key_checking(/home/gaudenz/.ansible.cfg) = False
```


### OS / Environment

Debian testing

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```
$ ansible -m debug -a 'msg={{ lookup("password", "mypassword encrypt=sha512_crypt length=10") }}' localhost && ls -l --full-time mypassword && md5sum mypassword
localhost | SUCCESS => {
    "msg": "$6$Ec9Z80iDXuPXULzQ$419PY89EUBGUmpbyPKpoFCoM.VfrDahpUM91EOexZRQfsVmasGZk5fDoMAMS6ymGY2cQAp7It9iAzI2lnpkCn0"
}
-rw------- 1 gaudenz gaudenz 33 2022-11-21 15:54:03.976492618 +0100 mypassword
037a9e24e504f7c50a40e6f6c562ff5f  mypassword

$ ansible -m debug -a 'msg={{ lookup("password", "mypassword encrypt=sha512_crypt length=10") }}' localhost && ls -l --full-time mypassword && md5sum mypassword
localhost | SUCCESS => {
    "msg": "$6$Ec9Z80iDXuPXULzQ$419PY89EUBGUmpbyPKpoFCoM.VfrDahpUM91EOexZRQfsVmasGZk5fDoMAMS6ymGY2cQAp7It9iAzI2lnpkCn0"
}
-rw------- 1 gaudenz gaudenz 33 2022-11-21 15:54:11.916522686 +0100 mypassword
037a9e24e504f7c50a40e6f6c562ff5f  mypassword

```


### Expected Results

The second invocation should not change the file modification time.

### Actual Results

```console
The second invocation changes the file modification time without actually changing the file content.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
filename=u'/path/with/unicode/くらとみ/file',
        params=dict(length=DEFAULT_LENGTH, encrypt=None, ident=None, chars=[u'くらとみ'], seed=None),
        candidate_chars=u'くらとみ',
    ),
)
class TestParseParameters(unittest.TestCase):
    def setUp(self):
        self.fake_loader = DictDataLoader({'/path/to/somewhere': 'sdfsdf'})
        self.password_lookup = lookup_loader.get('password')
        self.password_lookup._loader = self.fake_loader
    def test(self):
        for testcase in old_style_params_data:
            filename, params = self.password_lookup._parse_parameters(testcase['term'])
            params['chars'].sort()
            self.assertEqual(filename, testcase['filename'])
            self.assertEqual(params, testcase['params'])
    def test_unrecognized_value(self):
        testcase = dict(term=u'/path/to/file chars=くらとみi  sdfsdf',
                        
                        params=dict(length=DEFAULT_LENGTH, encrypt=None, chars=[u'くらとみ']),
                        candidate_chars=u'くらとみ')
        self.assertRaises(AnsibleError, self.password_lookup._parse_parameters, testcase['term'])
    def test_invalid_params(self):
        testcase = dict(term=u'/path/to/file chars=くらとみi  somethign_invalid=123',
                        
                        params=dict(length=DEFAULT_LENGTH, encrypt=None, chars=[u'くらとみ']),
                        candidate_chars=u'くらとみ')
        self.assertRaises(AnsibleError, self.password_lookup._parse_parameters, testcase['term'])
class TestReadPasswordFile(unittest.TestCase):
    def setUp(self):