Don't use SDL_memcmp() on modes to check if they've already been added.

They might have different driverdata values and thus not match.

Fixes Bugzilla #1407.
Don't copy structs to stack in cmpmodes(), use const pointers instead.

(and return 0 immediately if the pointers are the same.)
Changed some for-loops to be a bit more clear.