gru: fix bug in allocation of kernel contexts