PIC32 - Jumping from application to bootloader without a software reset
Maybe you want to re-think your application some. Using the boot loader should be a seldom needed activity that can be relegated to non-standard system behavior. As such there should be minimal, if any need at all, to maintain GPIO states through a software reset/restart. 

I can think of no instances where your application should not be able to work in boot loader mode without depending upon special states of GPIOs setup in the application portion of the code. I say this because the boot loader still has to work in cases where it starts with no application present or in cases where there was an interruption of the application programming process and the application is invalid.

If you have partitioned your system design where some GPIO states are setup in the boot loader and then you try to depend upon those states in the application then I think you have architected things incorrectly and should take a careful look at isolating your boot loader logic from the application logic to the greatest extent possible. 

If there is indeed some critical state that does need to be maintained then I believe that is best handled in an external I2C GPIO expander that is decoupled from the processor transitions into and out of the boot loader mode.