Move counting into separate function
Add fork_in_bg utility function
Use fork_in_bg with counting in glideinFrontendElement