Improve main() error handling
Improve main() error handling

Parse the command-line arguments first, and do not ignore avformat
network init failure. At the end, deinit the avformat network.

Genymobile/scrcpy,Genymobile/scrcpy,Genymobile/scrcpy