Added async PreLoginEvent to change online mode per connection.

Pretty much the same as #638 but for 1.7.2.