Add sed_contains to file.py module
Use sed_contains in file.sed state to check 'before' pattern
Rewrite file.sed_contains to run its own sed command

Fixes #4425
Fixes #3342

file.sed automatically adds the -i flag, which makes sed not print as
expected, breaking our contains check. It makes more sense to run
our own sed command here than to add a new flag to file.sed just for
whenn we call it from file.sed_contains
Merge pull request #4459 from basepi/sed3342

Fix `file.sed` state to use sed to check 'before' pattern