Terminates a process by using DuplicateHandle and DUPLICATE_CLOSE_SOURCE flag.