Add maximum open instances

Some activities don't behave well if more than one instance is
open. This patch sets a limit on the number open instances of an
activity based on a new field in activity.info: maximum_instances.

If and only if the field is present, it is used to set the limit of
open instances.

NOTE: there is a patch to bundleactivity.py in the toolkit necessary
for this patch to be used.