Multiple reasons
onClientPlayerQuit is for remote players only. (Other players than yourself)
Currently when another player leaves, the stats of all other players are being saved, except yours.
When you quit the game, the client code on your system will stop.
Not sure if there is enough time to send data on onClientResourceStop + resourceRoot. But I wouldn't rely on it.
Using a timer to delay sending data, makes things really impossible.
Other issues:
onClientPlayerWasted should be attached to the localPlayer, not the root element. Else it also triggers for remote players.
addEventHandler("onClientPlayerWasted", localPlayer, onPlayerWasted)
The source from remote events can't be trusted, use the predefined variable client instead:
if not exports.login:isPlayerLoggedIn(client) then return end
exports.login:updatePlayerStat(client, "stat", "stat", data)