Workaround for ids in unknown state

Sometimes when restoring packages which are not installed on the
system stat might be called before the user and group ids of the
program are set. As a quick workaround we sleep for one second before
calling stat.