Fix #64293: PHP fails building openssl ext when using pkgconfig 0.28

The problem is because of a change in pgkconfig 0.28 that trims the output of
pkg-config --cflags-only-I openssl.

This cause the 'if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then' to
fail and -lssl is no longer passed to the build.

Splitting the check in two resolves the issue.