Added collision detection to button detect

If new assigned button/joystick is equal to any of already assigned, the
other equal button index (not the one that was assigned last) is changed
to some not assigned value.
It works both with manual assignment and automatic assignment.