shell: fix history optimization

Commit f7c4fe677823 ("shell: optimize history storage a bit") forgot
to distinguish between the newly allocated history item and the previous
one, causing havoc on ring buffer wraparounds with excess padding.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
1 file changed