Labour's child poverty strategy will make it a legal duty for GPs and teachers to be told when a child becomes homeless.