[misc] Add a function to update a record field.
[misc] Add a function to update a record field.

Replaces this

  handle_something(#state{field = Value} = State) ->
      NewValue = do_something(Value),
      State#state{field = NewValue}.

with

  handle_something(State) ->
      misc:update_field(#state.field, State, fun do_something/1).

In certain situations it's more readable.

Change-Id: I7331c3ab659b9b7ae70d8169dcb426761ee02074
Reviewed-on: http://review.couchbase.org/89060
Reviewed-by: Aliaksey Artamonau <ce14b1c16e0fd654f926118eb8addbec5aff4ffa@couchbase.com>
Tested-by: Aliaksey Artamonau <ce14b1c16e0fd654f926118eb8addbec5aff4ffa@couchbase.com>

membase/ns_server,membase/ns_server,membase/ns_server,membase/ns_server,membase/ns_server,membase/ns_server