Set a retention limit per instance for storing actions

Because the number of actions on an instance is unbounded, over time
this could lead to a large amount of database storage.
actions_retention_limit will set a cap on the number of actions stored
per instance and older ones will be deleted as new ones occur.

Change-Id: I632424a84cc37dc1d1d46ae947abbeb704d57a9b