Add an OstreeSysrootUpgrader API

This moves some utility code from the ostree tool into the shared
library, which will make it easier to consume by external tools.