Unify escape_str() array input and LIKE logic

Added protected method _escape_str() to deal with quote escaping.