Nondestructive, inductive measurement of critical current densities of superconducting films in magnetic fields