Ticket 47967 - cos_cache_build_definition_list does not stop during server shutdown
Bug Description: If the COS cache is being rebuilt (where there are many COS
definitions/templates), attempting to stop the server can
take take a very long time.
Fix Description: In the callback functions check for server shutdown to abort
out of the search callback loops.
https://fedorahosted.org/389/ticket/47967
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 99f99743617c1d082e748e7d3e83adf953d2ad05)