This might be of interest. The xdg-mime script does generally save, set, and restore the umask but near exit runs gnome's update-mime-database script which does not properly handle a poor choice of user umask. So either xdg-mime needs to run the gnome script with a proper umask not the users or that system script itself should properly handle saving setting, amd restoring the umask.
This is a bug in xdg-mime or more likely a bug in gnome's update-mime-database and has nothing to do with Calibre at all. It will happen with any use of xdg-mime on a broken system.
See
https://bugs.launchpad.net/ubuntu/+s...s/+bug/1082945