(PUP-2987) Windows service runinterval parsing

 - Refactor parsing code to a separate method to cleanup run loop
(PUP-2987) Restructure Windows service code

 - Move runinterval parsing and execution of the puppet agent to a new
   thread that maintains a busyloop until either:
    - the service is no longer running
    - an exception has occurred with parsing the runinterval
 - Rather than performing a wakeup against the main thread, simply kill
   this new thread on service_stop
 - Main service code will wait until the busyloop thread dies, then will
   exit
 - Note that this change is ultimately not responsible for the service
   hangs experienced in the service.  Additional changes have been made
   to the win32-service gem to ensure events being waited on with
   WaitForSingleObject are always signaled properly, even in failure
   cases.  Please see merged PR for more info:
   https://github.com/djberg96/win32-service/pull/21
   https://github.com/puppetlabs/puppet-win32-ruby/pull/51
Merge pull request #2936 from Iristyle/ticket/master/PUP-2987-windows-service-hangs

(PUP-2987) Windows service hangs
(doc) Add documentation for environments api call

The environments resource was updated but documentation was not changed
to reflect the changes.

This commit adds the documentation to describe new functionality.
(PUP-2999) Use host.tmpdir for agent tmpdirs

PUP-2999 switched these two tests to use Beaker's new
create_tmpdir_for_user() helper, but this has a bug related to windows
acceptance (QENG-1108) in that it doesn't end up prepending a 'cmd.exe
/c' and we get pathing issues with our current acceptance setup on
windows.

Just switching back to using host.tmpdir calls for now; the original
changes were for jvm-puppet, but that is master only, and these are
agent calls.
Merge branch 'issue/master/pup-2999-agent-tmpdirs-on-windows'

* issue/master/pup-2999-agent-tmpdirs-on-windows:
  (PUP-2999) Use host.tmpdir for agent tmpdirs
Merge pull request #2994 from demophoon/maint/master/fix-http-environment-doc

(doc) Add documentation for environments api call
(PUP-1044) Ensure file bucket streams are closed at all times after use

This makes the stream() method on file bucket file take a block
to ensure that the processing of the stream always ends up closing it.
Merge pull request #2999 from hlindberg/PUP-1044_ensure-closed-filebucket-file

(PUP-1044) Ensure file bucket streams are closed at all times after use