Optimize quoteIdentifier() a tiny bit.

This removes one pointless preg_replace() call that isn't reached often
but is un-necessary from what I can see.
Replace simple cases with a simple regex.

Hopefully this regex runs a wee bit faster than the last one and saves
some time in the optimistic cases.
Avoid boolean cast.
Simplify a regex a bit.

We don't need the optional conditions as they are handled earlier now.
Merge pull request #4894 from cakephp/minor-optimizations

Minor optimizations