##### SUMMARY
When in check mode, the check_file_attrs function is still called. This calls `module.set_fs_attributes_if_different,` which eventually raises an exception in `module.set_mode_if_different` if the file doesn't exist. This situation can occur when running in check mode when the destination file does not yet exist, even if `create` is set to `yes`.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
htpasswd

##### ANSIBLE VERSION
```paste below
ansible 2.8.0
  config file = /Users/matthieu/dev/ansible/ansible.cfg
  configured module search path = ['/Users/matthieu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/matthieu/.pyenv/versions/3.6.3/envs/ansible/lib/python3.6/site-packages/ansible
  executable location = /Users/matthieu/.pyenv/versions/ansible/bin/ansible
  python version = 3.6.3 (default, Oct  9 2017, 18:08:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
```

##### CONFIGURATION
```paste below
ANSIBLE_PIPELINING(/Users/matthieu/dev/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/Users/matthieu/dev/ansible/ansible.cfg) = /Users/matthieu/dev/ansible/ansible.log
DEFAULT_REMOTE_USER(/Users/matthieu/dev/ansible/ansible.cfg) = root
```

##### OS / ENVIRONMENT

From Mac to Linux 16.04


##### STEPS TO REPRODUCE

Run a playbook in check mode that contains this task:

```yaml
- name: Set up basic auth credentials file
  htpasswd:
    create: yes
    crypt_scheme: apr_md5_crypt
    name: "testuser"
    password: "testpass"
    path: "/tmp/thisfiledoesnotexist.htpasswd"
    state: present
```

Please note a very similar bug was already fixed in v2.4 https://github.com/ansible/ansible/issues/32676 
It may be worth to write a test case for this scenario...

##### EXPECTED RESULTS

The check run should complete successfully with a note that the file will be created.

##### ACTUAL RESULTS

I get the following error message:

`[Errno 2] No such file or directory: '/tmp/thisfiledoesnotexist.htpasswd'`

This is what I get when I run ansible-playbook with -vvv:
```
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_htpasswd_payload_b44M9M/__main__.py", line 268, in main
    check_file_attrs(module, changed, msg)
  File "/tmp/ansible_htpasswd_payload_b44M9M/__main__.py", line 192, in check_file_attrs
    if module.set_fs_attributes_if_different(file_args, False):
  File "/tmp/ansible_htpasswd_payload_b44M9M/ansible_htpasswd_payload.zip/ansible/module_utils/basic.py", line 1339, in set_fs_attributes_if_different
    file_args['path'], file_args['mode'], changed, diff, expand
  File "/tmp/ansible_htpasswd_payload_b44M9M/ansible_htpasswd_payload.zip/ansible/module_utils/basic.py", line 1063, in set_mode_if_different
    path_stat = os.lstat(b_path)
```

import atexit
import errno
import datetime
import grp
import fcntl
import locale
import os
import pwd
import platform
import re
import select
import shlex
import shutil
import signal
import stat
import subprocess
import sys
import tempfile
import time
import traceback
import types
from itertools import chain, repeat
try:
    import syslog
    HAS_SYSLOG = True
except ImportError:
    HAS_SYSLOG = False
try:
    from systemd import journal