Fixed #19523 -- Improved performance of Django's bash completion

Previous version took about 150ms to source, even on a warm cache,
primarily because it forks+execs /usr/bin/basename 44 times.
This patch makes it faster by a factor of 5 (and I imagine that a little
more thought would reduce the time to effectively zero).