helper for turning the process into gen_server

Change-Id: I4e318e9d95e97c8cfb0fc3b7531efc71e5b39973
Reviewed-on: http://review.couchbase.org/42685
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>