Support collections for third parameter of preg_replace() and friends

Summary: Before this diff, a collection passed as the third parameter to
preg_replace(), preg_replace_callback(), and preg_filter() would be cast to
a string, which is not the behavior one would expect or want. This diff
changes these builtins to treat a collection passed as the third parameter
the same as an array.

Reviewed By: @asukhachev

Differential Revision: D1472101