COMPAT: fix _bootlocale import error on py310
The _bootlocale module has been removed from Python 3.10.

https://github.com/python/cpython/commit/b62bdf71ea0cd52041d49691d8ae3dc645bd48e1
thanks @fangchenli 