Fix APT initialization code when RUNFLAG_APTWORKAROUND is set