Print stacktrace in deferred panic handler

When a panic occurs in a goroutine of a connection, a proper stacktrace
is now printed.
Properly check if user name already exists

Explicitly check if a user name already exists in the database and
return a proper error if it does.