BUG: Make PyArray_PutTo respect writeable flag.

Closes #4465.
TST: Add some tests for ndarray.put.
Merge pull request #5216 from charris/cleanup-gh-5132

BUG: Make PyArray_PutTo respect writeable flag.