Fixed #21420 -- Autoreloader on BSD with Python 3.

Thanks Bouke Haarsma for the report.