Fixing ec2 tutorial deployment scripts

1) bug related to detection of running isntances
2) handling of ssh keys