BUG: adapt to numpy > 1.8

np.diag is not writeable in recent numpy versions
Merge remote branch 'upstream/master' into slice_motion_correction

* upstream/master:
  BUG: adapt to numpy > 1.8
almost there