App_server: fix various issues with hardware cursors

* X and Y coordinates of hot point were swapped for 1-bit cursors
* Prefer color cursor over 1-bit one if possible
* Adjust the XOR/AND masks for 1-bit cursors to what the hardware
expects
* Handle switching etween hardware and software cursor.

Patch by Looncraz and Ziusudra, fixes #9261.