Workaround so only one CTRL-C is required for a new prompt in --gui=qt

Only implemented for posix systems. On Windows SIGINT kills python,
and signal.CTRL_C_EVENT doesn't do anything.
Changed sleep in signal thread to .01 sec. Moved imports to top.
Use python timers instead of thread + sleep
keep track of the sigint timer, and cancel it on a new prompt
Added comments explaining the SIGINT timer
Made sigint_timer and got_kbdint module globals
Merge pull request #3219 from siyuz/ctrl-c_clear_line

Workaround so only one CTRL-C is required for a new prompt in --gui=qt.