Cast arguments to quaternion/octonion constructors so they still work when there's no implicit conversion available. Fixes #5369.