Use RetrievePropertiesEx instead of RetrieveProperties

Fixes bug 1183654

The fix also adds a configuration variable enabling the user to
configure the maximum amount of objects that can be retrieved by
the aforementioned function.

When using RetrievePropertiesEx the server may allocate resources
in case additional calls are made. These are addressed by reading the
extra resources using ContinueRetrievePropertiesEx (if necessary)
or CancelRetrievePropertiesEx (when the necessary result has been found).

DocImpact

(cherry picked from commit e331287cdd1300878bfb9bbb3630889370e5fa72)

Change-Id: Iec799f5c04e21017804711dbdcda1ebd318153f1