Man dies, thousands lose power as wild weather lashes NSW