MDEV-6796: Unable to skip filesort when using implicit extended key

Re-work test_if_order_by_key() to work correctly for extended indexes.