fix copy of array options

The previous code copied arrays in the option object by reference.
This was modifying the original arrays. In case of a passed middleware array, 
this lead to multiple calls of cleanQuery if e-r-m was called on multiple models 
with the same option object.