Fix handling of non-int/array flags to filter_var

HHVM treats all non-int flags to filter_var as arrays, but Zend treats all non-array flags as ints. This causes spurious notices (#1068), but also causes bugs (e.g. line 3 of the new test rejects the IP on Zend but not HHVM).

Fixes #1068.