Support safecookie auth

Vidalia needs to support safecookie auth, and for that we need to implement HMAC-SHA-256 inside it so we don't need OpenSSL (possibly just a simple copy paste from the tor code).