I've attached a patch to fix the bug. The fix is that, if `imenu-auto-rescan` is enabled, the current `imenu--index-alist` is returned, otherwise it's returned with the `*Rescan*` option.