CA-145177: [UnitTest] unit tests for flock.py

Various unit tests to cover flock.py module.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-145177: Remove non-used tests

flock.py contained some outdated test code. These smoke tests are no
longer valid, nor executed by anyone. As the flock.py module is already
covered with proper unit tests, the smoke tests are no longer needed.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-145177: Remove non-used method

Flock's __setattr__ is providing setters for its fields:

 l_type l_whence l_start l_len l_pid

...but no client ever wants to use that mechanism, thus __setattr__ is
not needed, removing it for cleaner code.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-145177: Fix PEP8 violations

Fix various PEP8 violations in flock.py module.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-145177: Remove non-used code

ERROR_NOTLOCKED is not used anywhere.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-145177: Raise exception on double lock attempts

assert statements were used to guard against double locks. assert should
not be used to enforce business logic, so assert mechanism is replaced
with raising a custom exception, AlreadyLocked.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>