Bug #2045: wrap around the vnc port number
(cherry picked from commit 005aa35739ac1b2ebe8646fc21283e75b8b5f785)