[backend] fix cert generation that was broken by some earlier commit

It used the old private key to generate the cert, instead of the newly
generated one. Before that commit, cert generation was done as a
second step.
[api] delayed job has no user set, so fix crash there
[dist] travis recommends retrying

http://about.travis-ci.org/blog/2013-05-20-network-timeouts-build-retries/
[api] store the last number from lastevents in the database

It is pretty much overkill to have a table for a single value,
but it might get useful in the future and the alternative is writing
a file and it feels so unrailsy
[api] remove obsolete wrapper script
[api] scan linkinfos from backend and store them (as copy) in DB