front: Fix regression in rom header calcs (fix cheats regression).

Regression introduced in commit
316954b07b56eb2a55d5fed31bc856ee325446aa

Forgot to port the swap_rom(.) and trim(.) functions from C to Java.
Headers for some roms are saved in a different byte order, which wasn't
being accounted for.

Also, an assortment of small fixes
 - better use of try/catch/finally
 - change unknown fields from ints to bytes
 - name is empty rather than null on read error