(PDB-1029) Provide an arity detection for backwards compatibility for profiling

This patch fixes the arity problem on the oldest version of Puppet we support
by adding a compatibility layer that uses the correct argument list based
on the methods arity available.

Signed-off-by: Ken Barber <ken@bob.sh>