Run loop

This rewrites the run loop in Puppet::Daemon. Most of the functionality is implemented using a new Scheduler class, allowing much improved testing. This should fix #18211 (agent sleeping past runinterval) and #14766 (splay ignored after first run for daemonized agents).