I had the same problem... I think classes for your bean are loaded from different resources (one in .../lib and one out of the ear-file). Two instances of one type are different, if they were loaded through different class-loaders (e.g. different resources).
I'm sorry, but I have no solution found yet...
Hope that helps...
While I haven't done this type of stuff in a login module, I generally find I need to use scoped class loading by specifying loader-repository elements in the jboss-app.xml file to keep things separated. With scoped class loaders, I am able to hot-deploy any parts of my app without having problems in the other parts.
Hope that helps,