ide: add __ide_wait_stat() helper