Lazy connect, fixes #71

Nothing too important over commits discussed in #71. The last fix (the locking before login) should improve the speed of server start up on multithread servers with SF_LAZY_CONNECT.