tr.detrend not respecting masked arrays

Using tr.detrend with masked Traces gives wrong results (due to underlying routines not respecting masked arrays), e.g.:
```python
import numpy as np
from obspy import Trace
x = np.arange(10)
x = np.ma.masked_greater(x, 3)
tr = Trace(x)
print tr.data
tr.detrend("demean")
print tr.data
```
results in
```
masked_array(data = [0 1 2 3 -- -- -- -- -- --],
             mask = [False False False False  True  True  True  True  True  True],
       fill_value = 999999)
array([-4.5, -3.5, -2.5, -1.5, -0.5,  0.5,  1.5,  2.5,  3.5,  4.5])
```