initrd.scripts: refactor setup_real_root and rootdev_init functions

These two functions were a real mess, and the cure is painful.
${REAL_ROOT} setup code and ${REAL_ROOT} init code are now cleaner
and easier to read. ZFS support should have been preserved but
I may have caused new regressions. These changes should be tested.