Update filelock.py

I was having crash issues due to the is_locked tag being true without creating the fd attribute to close. Moving the is_locked tag to immediately after the creation of the .fd attribute fixed it.