don't statically link libgcc/libstdc++ by default on OSX

Summary: A previous commit, 552b409dbc71cc9e8a0487fbd6e915f9d7330598, caused us
to always statically link for the sake of portability. However, there
currently exists a bug in (homebrew?) gcc which is causing exceptions
thrown by the application to call abort instead of properly unwinding
and allowing the exception to be caught. An example can be found here:
https://bugs.busybox.net/show_bug.cgi?id=7208

HHVM uses throw/catch in Repo::schemaExists to determine if a table
exists. This caused a runtime crash on OSX.

Ideally we'll be moving to clang on OSX in the near future anyway, but
if, for whatever reason, we want to use gcc *and* statically link at
some point, we can use the recently added cmake option STATIC_CXX_LIB
to do so.
Closes https://github.com/facebook/hhvm/pull/3480

Reviewed By: @JoelMarcey

Differential Revision: D1500299

Pulled By: @sgolemon
Fix information leak in hash_equals() implementation

Summary: Existing code had branches which could potentially be
exploited to determine $known_len.  Stick to always
doing the same work regardless of $known_len.

Note that this depends on the compilation of this:

  if (ki < known_limit) {
    ++ki;
  }

Turning into:

  CMP (ki), (known_limit)
  ADC (ki), 0

Since our BC->IR->ASM loop doesn't do that,
I moved it back to C++ where we get better
compilation.

Reviewed By: @apage43

Differential Revision: D1490528