[api] cache the result of project_or_package_link

To make this work, I added a new model CacheLine that remembers in the
database if something for a package or project was cached. If that
package is changed, the event creation will then delete the cache line
[api] try to fix coverage results