Don't modify pass-by-value copy of opts on module refresh

This probably quietly broke a lot of other things with multi-master but
the issue in question is #10900

Closes #10900
Fix salt-cloud ec2 requests containing spaces.

salt-cloud receives an error when trying to create an EC2 instance when
any number of argument values contain a space. This happens because
salt-cloud is incorrectly building the url string when calculating the
signature. AWS signature algorithm #2 requires that spaces be encoded
using %20, however python's urlencode method replaces them with a +.
The easy fix is to just search and replace in the encoded string.

I encountered this myself with a security group with a space in it.
This was reported in issue #10181
https://github.com/saltstack/salt/issues/10181

The error looks like this:
someinstancename:
    ----------
    Errors:
        ----------
        Error:
            ----------
            Code:
                SignatureDoesNotMatch
            Message:
                The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
    RequestID:
        12345678-9abc-def0-1234-56789abcdef0
Fix output of pkg.list_repo_pkgs (yumpkg)

This allows for the full list of available packages in each repo to be
returned. This was my original intention when I wrote this function, but
I didn't realize that I was missing versions in the output until I
researched github issue #16467.

The structure of the return dict had to be changed slightly to
accommodate the new behavior.

Additionally, rather than just sorting each list in place, this sorts
all versions for a given package in a given repo using
distuils.version.LooseVersion, to give an accurate sorting of versions,
and put the newest versions at the top of the list.
Merge pull request #16498 from rallytime/bp-16452

Backport #16452 to 2014.7
Merge pull request #16457 from cachedout/issue_10900

Don't modify pass-by-value copy of opts on module refresh
Merge pull request #16503 from terminalmage/list-repo-pkgs

Fix output of pkg.list_repo_pkgs (yumpkg)