fix race cleaning up lock files

Due to nondeterminism in the order that the global
locked_file object and the os module are destroyed,
one could receive the error:

  AttributeError("'NoneType' object has no attribute 'unlink'",)

This would result in subsequent edits to the ini file
waiting forever on the stale lock.

Reported at https://github.com/pixelb/crudini/issues/12