Preserve order of input
Preserve order of input

One annoying aspect of pick is that the order of input lines is not
preserved when the query is empty. By allocating the input in one
consecutive block of memory the fallback sorting method can be
simplified to comparing the address of the two choices corresponding
lines. The initial order of the input will then always be preserved
since &line[i] < &line[i + 1] holds true.

The input allocation and choice creation is done in two separate steps
in order to avoid the need to update any existing previous choice line
pointers if the input memory block gets reallocated and moved to another
region. In terms of theoretical time complexity it's still a linear
operation.

As a pleasant side-effect the number of necessary allocations has been
reduces since the choice string and description is no longer duplicated.

calleerlandsson/pick,thoughtbot/pick,DBOTW/pick,calleerlandsson/pick,thoughtbot/pick,thoughtbot/pick,thoughtbot/pick,prahlad37/pick,calleerlandsson/pick,DBOTW/pick,prahlad37/pick,prahlad37/pick,prahlad37/pick,DBOTW/pick