How to stop Disk Utility?
It is failing to write the partition map on the flash-drive (step before formatting the filesystem) in order to do anything with it, so should be in a safe place to force-quit disk utility.

FWIW, it might be worth trying another file-system before you bin it.