(#11108) Make the pkgdmg provider able to install a remote flat pkg file

Without this patch applied when the pkgdmg provider is used to install a remote flat pkg file, the installation fails. This is becasue the installer expect a file with the .pkg extension and the curl command used to download the remote package set as output a filename without any extension. This patch fixes the problem by adding the correct extension to the curl output parameter.
(#11108) Test coverage for remote pkg file

The current implementation of tests for the pkgdmg provider only test
the behavior for packages without a file extension if they're being
installed locally. This commit adds tests for remote pkgs so that if a
file extension is not given in the package tile, it's extracted from the
package source.
Merge branch 'pull-1648'

This closes GH-1648