Good news - the system will automatically disconnect you from the device when you haven't played for a certain length of time (3-5 minutes). Any funds that are on the machine will be returned to your account when it disconnects.
Important note - some older machines have a "committed amount" or "bank". These funds cannot be transferred back to the account. All other available funds will be transferred back.