Daniel Dubois gave a boxing masterclass, dropping Anthony Joshua in the opening round before finishing it off in the fifth to retain his IBF heavyweight belt.