plugins/alarm_curl: use CRLF instead of LF for line break in MIME

Though most programs accept LF, MIME RFC explicitly requires CRLF.
plugins/alarm_curl: add SSL option to skip certificate verification

The new option ssl_insecure is equivalent to curl command line
option --insecure or -k, which is useful for posting alarms via
HTTPS to a server with self-generated certificate installed.
plugins/alarm_curl: fix read callback function for libcurl

The read callback for libcurl shouldn't return size that is larger
than the requested size when it's too small to hold email header.
Otherwise curl will abort the operation. And we shouldn't return
1 (which is the current behavior) while there is no header at all.

The expected size of the infile set by option CURLOPT_INFILESIZE
or CURLOPT_INFILESIZE_LARGE should include both header and body
sizes. The infile size is used when server supports the optional
"SIZE" parameter of "MAIL FROM" command. libcurl hangs when wrong
size is passed in.

Since email header remains unchanged for each alarm_curl instance,
we don't have to generate it per alarm request. Based on this, the
solution is quite simple: we generate the header once during
initialization and use it for all alarms.
plugins/alarm_curl: fix race condition

A thread may run immediately after it's created. Trying to pass
parameter to thread using uwsgi_thread->data without preventing
the thread from accessing it first is a race condition. If the
thread accesses uwsgi_thread->data first, uwsgi gets killed by
SIGSEGV.

And creating a dedicated thread for each alarm_curl instance is
overkilling. If we worry libcurl would block the master process,
we set its timeout to small value or reuse the alarm thread created
by the master process.

This patch removes the dedicated thread for alarm_curl thus fixes
the problem. Next patch will make alarm_curl to reuse the alarm
thread created by the master process.
plugins/alarm_curl: use alarm thread to handle curl-based alarms

The alarm_curl instance created by the master process can be
accessed in the alarm thread without any problem because all
the data is stored in heap which is shared by the thread and
the master process.

Reusing the alarm thread for alarm_curl will eliminate the
need of creating dedicated thread from each alarm_curl instance
and prevent the alarm_curl from blocking the master process.