FIX SGD: restore GIL on loss/dloss calls

Inheritance, cpdef and nogil don't cooperate nicely.
WIP trees and nogil