Submillimetre observations of the two-component magnetic field in M82