workaround for 32-bit systems to handle filesizes bigger than 2GB

workaround for 32-bit systems to handle filesizes bigger than 2GB 
refs #388 

Please review @MTGap @icewind1991 @karlitschek @bartv2 @butonic THX