Fixes to tab-complete

If a filename that you wanted to tab-complete had the characters '[', ']', '*' or '?', they would be recognized as part of a regular expression and would not be completed properly. Commit  	68d5b72 fixes this.

Another problem would happen if a tab-completed file name had accented characters, commit  df0fb5d fixes this.

An still open problem that I found when debugging this patch is that right now it is only possible to input the ASCII characters from 32 to 126. This is a limitation for non english locales. My system, for example, is running in pt_BR, and I cannot input characters like 'á', 'â', 'ã' and 'ç'. Unfortunately the only way that I could find to fix this is to use get_wch() instead of getch(), but this was only added to python 3.3.