Fix cookies with far expiration date.

Some websites set cookies expiring in the (not so) far future, after year 2038.
So, using time_t to store the cookie expiration date won't do. Use the
BDateTime class instead.

This makes goodsearch.com login work again (#10460).
Make signal handler static

We don't want this method to be exposed in the global namespace!
Also add a note about removing this signal-based solution when our
close() method can be interrupted in other ways.

thanks axel for watching!