Finite-size scaling and the deconfinement transition in gauge theories