base: genlock: Correct the lock file reference count.

genlock_get_fd_handle API creates a new FD and attaches
it to lock file and shares this FD to second process.
Now, two file descriptor are pointing to same file.
If one FD is closed, lock file will be closed. This
changes add a extra reference to lock file as new FD
has been attached. Taking this reference will make sure
that file doesn't get close. This refrence will go when
client will call close on this FD.

Change-Id: I3524bed5ededd89d43ca6d8b85df11c85c03c1e3
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
sync: Fix a race condition between release_obj and print_obj

Before this change, a timeline would only be removed from the timeline
list *after* the sync driver had its release_obj() called. However, the
driver's release_obj() may free resources needed by print_obj().

Although the timeline list is locked when print_obj() is called, it is
not locked when release_obj() is called. If one CPU was in print_obj()
when another was in release_obj(), the print_obj() may make unsafe
accesses.

It is not actually necessary to hold the timeline list lock when calling
release_obj() if the call is made after the timeline is unlinked from
the list, since there is no possibility another thread could be in --
or enter -- print_obj() for that timeline.

This change moves the release_obj() call to after the timeline is
unlinked, preventing the above race from occurring.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
fix build error after fb update

Change-Id: Id26ef0591da551267de8bd68b99511836ad07d57