Load external rom - #2

My previous commit caused RetroArch to crash when back button was pressed, so I fixed the issue.
Another problem came out, if back was pressed the rom was reloaded, so I added a value in sharedpreferences to be checked, to make retroarch understand if it has to move back to the caller application or load a rom.

However, if the back behavior is set to show menu instead of quit, the value isn't updated and the fix doesn't work. 
A full fix would require to update the value from native code on quit from retroarch menu.