gdb: move display of completion results into completion_result class

This commit moves the printing of the 'complete' command results out
of the 'complete_command' function.  The printing is now done in a new
member function 'completion_result::print_matches'.  At this point,
this is entirely a refactor.

The motivation for this refactor is how 'complete' should print the
completion of filename arguments.  In some cases the filename results
need to have escaping added to the output.  This escaping needs to be
done immediately prior to printing the result as adding too early will
result in multiple 'complete' results potentially being sorted
incorrectly.  See the subsequent commits for more details.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
3 files changed