(#22729) Fix reject function shadows stdlib function with same name

The reject function in puppet core shadows the stdlib function with
the same name. This is bad because it prevents the reject function
from being used when not using future parser. (The core version requires
a puppet lambda).

This commit fixes the problem by letting the core reject function
also operate on a regular expression in string format. This makes the
function compatible with the stdlib variant.