Convert sbin/mdconfig/tests from prove format tests to ATF format tests

As a side effect...
1. The tests now checks for the root user before continuing with kyua, which is
   more visible than the test being skipped with the TAP protocol
2. The tests work with devices that aren't /dev/md0 by caching the device
   attached during the test to a file, and later use the cached information to
   detach the device in the cleanup routine
3. The tests no longer require perl to run

MFC after: 1 week
PR: 191191
Sponsored by: EMC / Isilon Storage Division
Fix hwpmc sampling for MPC74xxx (G4) processors.

With this, hwpmc sampling now works correctly on these processors.

MFC after:	3 weeks
Relnotes:	yes
clean_build is not always done (*), so move the mkdir to the first step
that needs it and is always done: make.conf build.

(*) In our build environment we actually never do a clean build unless
instructed to do so, to make sure we do not accidentally delete the
built world when on a tight schedule.
Merge remote-tracking branch 'freebsd/master' into hardened/current/master
Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/aslr