Make HandshakeManagerImpl more thread-safe, as recommended by FindBugs