Allow limiting server-side selection size (#13334)

Also refactors the handling of selections received from the client to
cope with situations where the requested selection was not applied even
though there were no additional selection events.

Change-Id: Ia3b5b2ac228caa3755217deb38841cdfb5d63113