Discrete subgroups of locally definable groups