terminal: Fix autocomplete and reduce total code and data size at the expense of cpu time.
Previously, only half of the autocomplete values were printed when attempting to tab-complete. Additionally, a large buffer was being used to cache autocomplete information when possible, however cpu time isn't very important when using the shell. Instead, prioritize code size by removing the buffer and related functions.