monkey_patch: Fail if it is too late to monkey-patch

If the thread or threading modules were already imported, it is too late
to monkey-patch them; leading to mix of locks and condition objects in
the same process.

This patch makes monkey_patch fail in this case, and adds the missing
tests for monkey_patch.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>