Fix a ResourceWarning in test_shared.

Thanks to Arfrever for the patch.  This fixes #593.
Fix a ResourceWarning in test_entrypoints.
Fix a ResourceWarning in test_xunit.
Get rid of another ResourceWarning in test_skips for the xunit plugin.
Fix a ResourceWarning in init_plugin.rst.