features/locks: Do not try to set value in dict when lookup has failed.
features/locks: Do not try to set value in dict when lookup has failed.

lock-count was being set without checking for op_ret from lookup. This would
cause a lot of Critical messages in the log as dict would be NULL in case
of a lookup failure.

Also, removed some trailing white spaces and did some minor re-factoring.

Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 306 (Enhance locks to aid debugging)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=306

Kaushikbv/Gluster,Kaushikbv/Gluster,Kaushikbv/Gluster