The only thing a shutdown logic would do is to clean up the very resources the OS cleans up anyway when interrupting the process. So I just don't see the point in the complexity of a signal handler (and SetConsoleCtrlHandler on Windows).
Interestingly libserialport doesn't complain about any weird value. So there's nothing to validate.
Surprisingly Windows doesn't complain about any weird value! So even the sp_set_config() succeeds!
So far up to two ports with the substring "usbserial" in their name were used. This was pretty platform specific and didn't allow to use non-USB ports at all.
Now if the -p option is given its value is used as substring as "usbserial" was used before. However if no -p option is given than up to two USB-backed ports are used.