Fix ASAN-identified memcpy issue

Summary: If the IV provided in `mcrypt_generic_init` is less than the expected IV size, we still memcpy a number of bytes equal to the expected IV size. That leads to an out-of-bounds read which ASAN detects.

We also don't want to mark the object as initialized in case of failure. This is consistent with https://github.com/php/php-src/commit/dd791cd71742fdb9b87b7166537fbb25bd7cd8b9

Reviewed By: @jano

Differential Revision: D1639516
Remove FORWARD_DECLARE_CLASS macro and associated typedefs.

Summary: The FORWARD_DECLARE_CLASS(T) macro was used to declare a class T and create a SmartPtr<T> typedef automatically. It seems clearer to use the SmartPtr<T> class directly than through a typedef.

Reviewed By: @jano

Differential Revision: D1736966