Make sure functions that call network.userid() are guaranteed to have context first



fixes #3130