Nonarray assignment regression for boolean indexing and 1d unsafe casting

There are two commits here, the first one is a regression in 1.7. and probably should be backported, the second one gives a special case the same behaviour as (most?) other code branches for index assignments has:

 1. Fix a regression that a = np.array([1,2]), b = np.array([True, True]) then a[b] = np.nan fails (but a[b] = np.array(np.nan) does not as it never did)
 2. Make 1d special case with r = np.array([0,1]), a[r] = 12.5 use unsafe casting as the rest of the assignments normally use, but still keep make a[r] = np.nan fail as before.