Abelianisation of orthogonal groups and the fundamental group of modular varieties