Fix the ".bnd perforce checkout lose your changes" problem.

This is rebased on 2.2.0 version of the perforce .bnd file checkout problem.