Add a new 'wait' flag to the rescan command. This allows the caller