József főherceg (1776-1847), cs. kir. tábornagy, Magyarország nádora (1796-1847)