[WIP] extracting learning rates to learning_rates.pxd and learning_rates.pyx

This pull request is for #3647
Hm, you have to have the GIL to get a NumPy array. I think it's better to allocate the array up front, in the constructor. You don't want to call `malloc` inside a loop, or even check for `NULL` if you need that memory anyway. Also, you must be prepared to raise an exception if `malloc` fails, and you can't do that without the GIL.

Note that your current code is unsafe because it presumes the pointer is `NULL` initially, while you haven't set it.