um, a bit of javascript could help this. when a user closes their browser you can force another window to open that only has the purpose of calling a script to destroy the session and regive the item its inventory. this has inevitable problems as not everyone has javascript or javascript enabled. there is also the problem of users closing the new window before it has a chance to call the script. and there is the problem of a lost connection (dail-up).
i would suggest that you have a cart that does nothing to the inventory until check out. this way you do not have a problem with 'missing inventory'. once the user goes through check out and actually pays for the goods, then deduct the inventory.
this may seem like a problem if you have one item of something left and two users have it in their cart. but this just lets the first to check out get the item. you can then give the other user an error when they try and check out with that item. or, you can check at every new page if the items in a user's cart are still available and give them a quick message that an item in their cart is no longer currently in stock.
just some ideas.