Motor and washing machine having the same