Use jlib:(node|name|resource)prep in close_session

This fixes two related bugs mentioned in #89 by @madprogrammer.
These bugs do not show up with Mnesia as `ejabberd_sm_mnesia` doesn't
use JID as part of the record key.