Is there a way to execute code before Blender is closing? My add-on needs to do some clean-up action before it is ended. This is done in the unregister() function in __init__.py when the user unchecks the add-on in Blender's preferences dialog and works fine in this case. But if the user just closes Blender the unregister() function seems not to be called. How could I achieve this or force Blender to do some other action before closing? There is no handler list for the event "Blender is closing" in bpy.app.handlers as far as I can see.
Yes, this is possible, You can use Python's atexit module.

This can be used exactly as you would writing regular Python code (no Blender specifics are required.).

eg:

import atexit

def my_cleanup_code():
    print("cleaning up!")

atexit.register(my_cleanup_code)