factored out AcceptSecurityContext call to function gen_server_context

Signed-off-by: abbr <wenfred@gmail.com>