Add replay detection for auth_digests, and fix a stupid deadlock.

If authKey is configured on the server, replayed auth_digests are
detected.  The implementation here is somewhat more simple than that
used in obfs4 in that it fails closed if the replay detection map ever
gets full.  Realisticall that  should never happen since it requires
200,000 unique handshake requests within a 3 hour time period all
with the same epochHour tweak.

Additionally fix a stupid deadlock on Close() due to holding onto the
lock while the write channel close is being done, by releasing the lock.