ec2: use SecurityGroup object

Convert one place in the ec2 API code that was using the db API
directly to get a security group.  Use the SecurityGroup object for
this instead.

Some test fixes were needed to account for fields that the
SecurityGroup object does not have set as nullable.

Change-Id: I4b15b6bcb35f95955911a48faa8d74f6167593a0
Merge "ec2: use SecurityGroup object"