save 'current version' when checking

previously current version was only updated when a build started or finished.
this meant that later checks would still check from a previously old version,
and trigger again.

this will result in skipping versions (e.g. if a build is scheduled but cannot
immediately trigger due to unresolved dependencies or serial: true), but
that's not as bad as triggering extra builds.