No need to patch. It's a bit of an overkill to save the flash.
I have put just this 3 lines into rc.local:
if [ -f /root/.ash_history ]; then rm /root/.ash_history; fi
ln -s /tmp/.ash_history /root/.ash_history
Personally I've added to the mentioned settings:
to dash through the history.