tests: Implement test_fcntl_lock correctly