Threshold corrections and modular invariance in free fermionic strings