Fix pow() to deal with abnormal data types

Summary: PHP5 special handling for types which Variant::toNumeric()
doesn't handle.  Create a specialized helper for those cases in the
form of convert_for_pow()

Reviewed By: @fredemmott

Differential Revision: D1430284