In Mendix 2.5.3 you can use the Core.getActiveSessions() api to query active users, without using persistent sessions. A sessions ends within 5 minutes after closing the browser.
To listen to the browser unload event a custom widgets needs to be build. However this won't be a reliable method since the browser does not always inform the page about being closed.