Work around `__file__` `NameError` thrown by `bbfreeze`. Fixes #5172.