Fire-resistant polymer nanocomposites based on metal oxides and hydroxides