[DO NOT MERGE YET!] 2014.7 modules.file.replace test coverage

**HELP NEEDED: See below**

Based on the things reported in #18612, attempted to fix in #18615 and an additional case reported in #18841 I started to write some integration tests for `modules.file.replace()`.
All new tests except of `test_replace_issue_18841` work fine after applying the changes to `modules/file.py` also provided by this PR. I need some help with this specific one.
This test sets `search_only=True`:
```Python
ret = self.run_state('file.replace',
    name=path_test, pattern='^hello world$', repl='goodbye world', search_only=True)
```
This should result in no `*.bak` file being created.
Running the test shows, that there is a `*.bak` file created instead.
Running the command directly on CLI works just fine.
Inspecting `ret` shows, that the following warning is raised:
```
'search_only' is an invalid keyword argument for 'file.replace'.
If you were trying to pass additional data to be used in a template context, please populate 'context' with 'key: value' pairs.
Your approach will work until Salt Lithium is out. Please update your state files."
```
Can anyone see why `search_only=True` isn't properly detected as keyword here?

Besides the tests which are provided with this PR, some more things should be tested regarding `replace()` such as:
  * are the `flags` honored in all cases?
  * can matching groups be used in `repl` in different scenarios?
  * is `count` respected in different scenarios?
  * handling of `bufsize`/`bufsize='file'`? Do multiline operations work properly?

Due to time limits someone else will have to take care of those things.
@rallytime `name` should be IMHO ok here, as it's the state which is executed in the integration (`self.run_state('file.replace', …)`) and not the execution module.

The `file.replace` function in the `file` state is a very thin wrapper around the same function in the corresponding execution module. The primary keyword to identify a state is usually `name` and so it is here.
See also line 2253 in `salt/states/file.py`:
```Python
changes = __salt__['file.replace'](name,
                                   pattern,
                                   repl,
                                   count=count,
                                   flags=flags,
                                   bufsize=bufsize,
                                   append_if_not_found=append_if_not_found,
                                   prepend_if_not_found=prepend_if_not_found,
                                   not_found_content=not_found_content,
                                   backup=backup,
                                   dry_run=__opts__['test'],
                                   show_changes=show_changes)
```
`name` is passed as the 1st positional argument to `file.replace`, so everything should be fine using `name` to define the path of the file when running the state integration test for `file.replace`.

Any other ideas what could be happening here causing this?