Clean shutdown of custom meterpreter executables on migrate and exit

Change `thread_kill` calls for exit and migrate to `thread_sigterm`. This makes the application shut down cleanly when exiting or migrating to another process. Changes are `#ifdef`ed to `_WIN32` so they have no impact on the POSIX version.

- [ ] Process exits cleanly without extra channels open.
- [ ] Process exits cleanly _with_ extra channels open (eg. port forwards).
- [ ] Works with `*_tcp`, `*_http`, `*_https`.
- [ ] Works as x86 on x86.
- [ ] Works as x86 on x64.
- [ ] Works as x64 on x64.