Factor out grouping of hosts by optimal PGPU

...for unit testing.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Fix host choice for vGPU allocation

The ordering for the group_by function when grouping hosts based on "best" PGPU
was not specified. Now the hosts should be ordered and grouped correctly
according to GPU_group.allocation_algorithm.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Unit tests for Xapi_vm_helpers (vGPU related)

Tests for assert_gpus_available and for group_hosts_by_best_pgpu_in_group.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1464 from simonjbeaumont/cp-5923-vm-helpers

Fix host choice for vGPU allocation (and unit tests)