(#17994) Generate a new file and dir each time

Previously, the test would reuse the same file and dir each time,
assuming that the chmod would set the initial mode correctly at the
start of each test using a numeric mode. However, on debian (at
least):

    SETUID AND SETGID BITS
    ...
    You can set or clear the bits with symbolic modes like
    u+s and g-s, and you can set (but not clear) the bits with
    a numeric mode.

Since we can't reliably set the initial mode using chmod, this commit
modifies the test to delete the file/dir at the start of every
test. This ensures that state from one test doesn't leak across.

Also, modifies the assert_match to account that the file path may
contain special regexp characters that need to be escaped.
(#17994) Handle setgid bit on Solaris specially

From the Solaris chmod man page, "For directories, the set-gid bit can
only be set or cleared by using symbolic mode." As a result, the test
that attempted to chmod the start_mode for a directory to 2744, and then
verify puppet could apply `g-s` fails, because the start_mode was never
set correctly.

We could use puppet to set the start_mode, as it correctly applies 2744
to a directory. But that breaks other tests that aren't expecting puppet
to magically make readable directories executable.

We could express start_mode as a symbol, `u=rwx,go=4,+s`, but that
requires reworking whether we expect a mode change or not.

So for now, we just skip the test on Solaris.

It also adds tests for u+s, g+s, u+t when modifying an existing
file/dir.

Another thing to keep in mind is that Solaris supports a mandatory
locking flag 'l'. When mode 2750 is applied to a file (so the permission
for the group class is executable), then the setgid bit is set as
expected: -rwxr-sr--

However, if the permission for the group class is not executable (2644),
then the bit corresponds to mandatory file locking: -rw-r-lr--
Merge branch 'ticket/master/17994-wrong-mode-not-octal'

* ticket/master/17994-wrong-mode-not-octal:
  (#17994) Handle setgid bit on Solaris specially
  (#17994) Generate a new file and dir each time