Ensure attribute keys of security group

I encountered an issue that security groups were swapped and it was detected as a change when I executed plan subcommand. Terraform destroyed the instance and created a new one again. I think that's not expected behavior.

This pull request is to fix the issue and added a few test cases.

```
~ aws_eip.fluentd
    instance: "i-d17fd2c8" => "${aws_instance.fluentd.id}"

-/+ aws_instance.fluentd
    availability_zone: "ap-northeast-1c" => "<computed>"
    key_name:          "id_rsa" => "<computed>"
    private_dns:       "ip-192-168-11-223.ap-northeast-1.compute.internal" => "<computed>"
    private_ip:        "192.168.11.223" => "<computed>"
    public_dns:        "" => "<computed>"
    public_ip:         "54.64.24.211" => "<computed>"
    security_groups:   "" => "<computed>"
    security_groups.0: "sg-d7cf37b2" => "sg-d6cf37b3" (forces new resource)
    security_groups.1: "sg-d6cf37b3" => "sg-d7cf37b2" (forces new resource)
    subnet_id:         "subnet-1df4f45b" => "<computed>"
```