Save a function restoring the state of minibuffer history search. Save `minibuffer-history-position' to the additional state parameter in the search status stack.