Catch instances less than zero error

This change prevents the number of App instances being set to a negative number, which can currently happen when using 'cf scale' for example.

This defect was initially reported back in September, exposed by a defect in a gradle plugin.