Fix memory leak when fitting multinomial distribution

Replicate the fix on R-Forge
http://r-forge.r-project.org/tracker/?atid=1813&group_id=443&func=browse
by Christophe Foussette
Fix bug introduced in commit f2f8c8f3cf3c494a

The object "junk" does not exist
Restore automatic multicore detection for CV

When n.cores is NULL, gbmCluster() detects multiple core automatically
and creates a cluster when appropriate. The code introduced in commit
9519046fe3bb49ad44dc to fix an issue with cluster detection checks
n.cores directly instead of checking the output of gbmCluster(). So
what was automatically parallelised before isn't anymore.

The current code checks the output of gbmCluster and still uses the 
non-parallel lapply() on machines with only one core.
Ignore object files produced by compiling cpp
Fix another potential memory leak

Undeleted object
Merge pull request #5 from jiho/feature/ignore_object_files

Ignore object files produced by compiling cpp
Merge pull request #2 from jiho/fix/memory_leak

Fix memory leak when fitting multinomial distribution
Merge pull request #3 from jiho/fix/gbm_typo

Fix bug introduced in commit f2f8c8f3cf3c494a
Merge pull request #4 from jiho/fix/automatic_cluster

Restore automatic multicore detection for CV