BUG-987: optimize illegal character search

As it turns out, we are not search for a substring, but rather for
characters. Move the array into static field so we do not allocate it
needlessly over and over. And make it a char array to save space and
increase checking speed.

Change-Id: I307813ad363441cf8ee63d383896e5fa6d2fb6e6
Signed-off-by: Robert Varga <rovarga@cisco.com>
Merge "BUG-987: optimize illegal character search"