WL#1333: Speed up ALTER TABLE (part 3: Rebuild unique indexes by sorting in ALTER TABLE)

Affects: Server-7.1   —   Status: On-Hold

Currently in MyISAM tables non-unique indexes are rebuilt by sorting on ALTER
TABLE (OPTIMIZE TABLE etc) which is fast, unlike it UNIQUE  (and PRIMARY) keys
are rebuilt by key_cache which is very slow on large table sizes especially if
keys are comming in random order  - the IO becomes random and so one is able to
insert just some hundred index values per second on commodity hardware.

We shall be able to use rebuilding by sort for unique indexes as well (using
modified filesort which alerts on dublicates) at least for the cases when we do
not need to find error as early as possible. 

One way to do it is to use UNIQUE_CHECKS variable (now it is for InnoDB only)