Unfortunately you are likely to find it very difficult to reliably detect when a user closes their browser. Thus you are likely to encounter many occurrences of a user unknowingly locking themselves out.
I typically hesitate to express personal opinions about questions, but this just seems too problematic. What is your justification for denying the user concurrent logins? My feeling is that this is an unreasonable restriction.