PYTHON-799 Create a PeriodicExecutor class for background monitoring.

The executor will also be used to solve a deadlock in Cursor.__del__.