Magnetic nanocomposites based on phosphorus-containing polymers—structural characterization and thermal analysis