spacemanager: Fix queries searching for glob match

Postgresql can only make use of indexes for the LIKE operator if the index
using C encoding. With UTF-8 encoding or any other local, the index cannot be
used, even when the pattern contains no wildcards and is equivalent to an
equality check.

This patch updates the space manager to detect this common case and use
an equality check if the pattern contains no wildcards.

Target: trunk
Require-book: no
Require-notes: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6499/