Added time(), gmtime_r(), read(), and write() replacements.

These are needed for statically linking openssl.
Include openssl/err.h file.