Cache some jobs in memory
Cache some jobs in memory

This patch adds a caching mechanisms to the JobStorage. Note that is
does not make the memory cache authoritative.

The algorithm is:
  - all jobs loaded from disks are entered in the cache
  - all new jobs are entered in the cache
  - at each job save (in UpdateJobUnlocked), jobs which are not
    executing or queued are removed from the cache

The end effect is that running jobs will always be in the cache (which
will fix the opcode log changes) and finished jobs will be kept for a
while in the cache after being loaded.

Reviewed-by: imsnah

apyrgio/snf-ganeti,ganeti/ganeti,ganeti/ganeti,onponomarev/ganeti,yiannist/ganeti,grnet/snf-ganeti,ganeti-github-testing/ganeti-test-1,ganeti-github-testing/ganeti-test-1,bitemyapp/ganeti,yiannist/ganeti,andir/ganeti,ganeti/ganeti,apyrgio/ganeti,andir/ganeti,leshchevds/ganeti,mbakke/ganeti,dimara/ganeti,bitemyapp/ganeti,mbakke/ganeti,grnet/snf-ganeti,dimara/ganeti,andir/ganeti,yiannist/ganeti,mbakke/ganeti,leshchevds/ganeti,apyrgio/ganeti,apyrgio/snf-ganeti,leshchevds/ganeti,onponomarev/ganeti