Fall back to getprotobyname() if Socket doesn't export IPPROTO_TCP or IPPROTO_UDP.

CPAN testers were failing POE because Socket didn't provide these on
the full range of test machines.  The common thread seems to be Perl
prior to 5.9.  While quite old, there's no compelling reason not to
support it.

This change also caches the protocol numbers at startup, rather than
looking them up every time.  It should be slightly faster as a result.