Add a per machine instance cap and fix instance cap limit calculation

Hey,

As said in the commit message the code for the instance cap limit fix is not mine and mainly comes from the [EC2 Plugin](https://github.com/jenkinsci/ec2-plugin).

(If you want me to do a separated pull request for the fix just ask ;) )

Jocelyn