Close connection when authentication fails