On the maximum principle for elliptic operators in weighted spaces