### Summary

"Permission denied" error is raised in "user" module of Ansible devel version when trying to generate SSH keys for user.

```yaml
    - name: Generate test key file
      user:
        name: "{{ ansible_env.USER }}"
        generate_ssh_key: yes
        ssh_key_file: .ssh/shade_id_rsa
```
-------------------------------------------

```
TASK [Generate test key file] **********************************************************************************************************************************************************************************************************
task path: /home/sshnaidm/sources/various/check.yml:44
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 13] Permission denied
fatal: [192.168.2.139]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDOUT:

Traceback (most recent call last):
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 107, in <module>
    _ansiballz_main()
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible.modules.user', init_globals=dict(_module_fqn='ansible.modules.user', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3221, in <module>
  File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3207, in main
  File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 1055, in set_password_expire
PermissionError: [Errno 13] Permission denied



MODULE_STDERR:

Shared connection to 192.168.2.139 closed.
```
This error is thrown by https://github.com/ansible/ansible/blob/2f0530396b0bdb025c94b354cde95604ff1fd349/lib/ansible/modules/user.py#L1055
I've found an old issue that was fixed: #39472  by PR #40341 but I don't see this fix anymore, or probably it was introduced again in commit https://github.com/ansible/ansible/commit/dbde2c2ae3b03469abbe8f2c98b50ffedcf7975f
Since then devel branch module fails.


### Issue Type

Bug Report

### Component Name

user

### Ansible Version

```console
$ ansible --version
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code
and can become unstable at any point.
ansible [core 2.14.0.dev0] (devel 5f5c4ef2ef) last updated 2022/06/08 23:07:15 (GMT +300)
  config file = /home/sshnaidm/sources/various/ansible.cfg
  configured module search path = ['/home/sshnaidm/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/sshnaidm/venvs/ansible-dev/src/ansible-core/lib/ansible
  ansible collection location = /home/sshnaidm/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/sshnaidm/venvs/ansible-dev/bin/ansible
  python version = 3.9.12 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] (/home/sshnaidm/venvs/ansible-dev/bin/python)
  jinja version = 3.1.2
  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_FORCE_COLOR(/home/user/sources/various/ansible.cfg) = True
CONFIG_FILE() = /home/user/sources/various/ansible.cfg
DEFAULT_ACTION_PLUGIN_PATH(/home/user/sources/various/ansible.cfg) = ['/home/user/sources/various/action_plugins', '/usr/share/ansible/plugins/action', '/home/user/venvs/ansible-dev/share/ansible/plugins/action', '/home/user/venvs/ansible-dev/lib/python2.7/site-packages/ara/plugins/action', '/home/user/venvs/ansible-dev/lib/python3.6/site-packages/ara/plugins/action', '/home/user/.local/lib/python3.7/site-packages/ara/plugins/action']
DEFAULT_CALLBACK_PLUGIN_PATH(/home/user/sources/various/ansible.cfg) = ['/home/user/.local/lib/python3.7/site-packages/ara/plugins/callback', '/home/user/venvs/ansible-dev/lib/python2.7/site-packages/ara/plugins/callback', '/home/user/venvs/ansible-dev/lib/python3.6/site-packages/ara/plugins/callback', '/usr/local/lib/python3.7/dist-packages/ara/plugins/callback', '/usr/local/lib/python2.7/dist-packages/ara/plugins/callback', '/nonexistent']
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/user/sources/various/ansible.cfg) = True
DEFAULT_ROLES_PATH(/home/user/sources/various/ansible.cfg) = ['/etc/ansible/roles', '/home/user/sources/ansible/test/integration/targets']
DEFAULT_STDOUT_CALLBACK(/home/user/sources/various/ansible.cfg) = debug
DEFAULT_TEST_PLUGIN_PATH(/home/user/sources/various/ansible.cfg) = ['/usr/lib/python2.7/site-packages/tripleo-quickstart/test_plugins', '/home/user/venvs/ansible-dev/usr/local/share/tripleo-quickstart/test_plugins', '/home/user/sources/various/test_plugins']
```


### OS / Environment

Fedora 34

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
    - name: Generate test key file
      user:
        name: "{{ ansible_env.USER }}"
        generate_ssh_key: yes
        ssh_key_file: .ssh/shade_id_rsa
```


### Expected Results

SSH keys are generated and no exception

### Actual Results

```console
TASK [Generate test key file] **********************************************************************************************************************************************************************************************************
task path: /home/sshnaidm/sources/various/check.yml:44
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 13] Permission denied
fatal: [192.168.2.139]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDOUT:

Traceback (most recent call last):
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 107, in <module>
    _ansiballz_main()
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible.modules.user', init_globals=dict(_module_fqn='ansible.modules.user', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3221, in <module>
  File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3207, in main
  File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 1055, in set_password_expire
PermissionError: [Errno 13] Permission denied



MODULE_STDERR:

Shared connection to 192.168.2.139 closed.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
cmd.append(str(calendar.timegm(self.expires)))
        (rc, out, err) = (None, '', '')
        
        if cmd_len != len(cmd):
            (rc, _out, _err) = self.execute_command(cmd)
            out += _out
            err += _err
            if rc is not None and rc != 0:
                self.module.fail_json(name=self.name, msg=err, rc=rc)
        
        if self.update_password == 'always' and self.password is not None and info[1].lstrip('*LOCKED*') != self.password.lstrip('*LOCKED*'):
            cmd = [
                self.module.get_bin_path('chpass', True),
                '-p',
                self.password,
                self.name
            ]
            _rc, _out, _err = self.execute_command(cmd)
            if rc is None:
                rc = _rc
            out += _out
            err += _err
        
        _rc, _out, _err = self._handle_lock()
        if rc is None:
            rc = _rc
        out += _out
        err += _err
        return (rc, out, err)
class DragonFlyBsdUser(FreeBsdUser):