CLOUDSTACK-7991: test_security_groups.py - Move config data to test_data.py and fix pep8 issues

Signed-off-by: Pierre-Luc Dion <pdion891@apache.org>
CID-1256273/CID-1256274/CID-1256275 leaky resources plus switch
statement warning

reviewed by Wilder Rodrigues
Ensure the response is a proper http response.

Tested that cloud-set-guest-password.sh still works after this change.

Reviewed-by: Daan Hoogland <daan@onecht.net>
CLOUDSTACK-7959: fixed 'qemu-img convert' compat issue