Extract interruptible sleep for server
Extract interruptible sleep for server

This improves readability, and makes the function reusable.

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

Genymobile/scrcpy,Genymobile/scrcpy,Genymobile/scrcpy