Refactor device configuration
Refactor device configuration

Depending on the parameters passed to scrcpy, either the initial device
serial is necessary or not. Reorganize to simplify the logic.

PR #3005 <https://github.com/Genymobile/scrcpy/pull/3005>

Genymobile/scrcpy,Genymobile/scrcpy,Genymobile/scrcpy