(#22581) Enable profiling for puppet apply

The profiler was only selected in the networking stack and so didn't let
users test out catalog compilation profiles using puppet apply. This
adds processing of the profile setting in the apply application's setup.
(#22581) Add test for apply profiling

Since apply doesn't need to change profiling while it is running there
is no need for it to explicitly set the profiling to NONE when it is
disabled. It can just use whatever the default for the system is.
However, since the *tests* will run in the same process we need to add a
method to Profiler to clear it back to the original state.
Merge pull request #1906 from zaphod42/feature/master/profile-via-apply

(#22581) Enable profiling for puppet apply