Use tempfile to check for writability

This fixes race conditions if multiple conda calls are happening at once.

Fixes #356.
Merge branch 'master' of github.com:conda/conda