Metric-affine variational principles in general relativity II. Relaxation of the Riemannian constraint