A 400 solar mass black hole in the Ultraluminous X-ray source M82 X-1 accreting close to its Eddington limit