new_dynarec: Fix Doom 64.

(cherry-picked by littleguy77)

Also fixes some (not all) collision detection bugs in DK 64.
See
https://github.com/ptitSeb/mupen64plus-pandora/commit/ce68e3b9f89132315d1bd69800e364da96340eb8
https://github.com/paulscode/mupen64plus-ae/commit/040b15fe91e7d4d351eba4768bcdb79ba8eeb371