Ive been bitten by this one a couple of times recently and want to remind myself for next time!
MsBuild doesnt shutdown after its been ran by default (performance improvements I expect). For integration development this is often a problem with bits being locked etc.
This can be turned off by adding the following environment variable:
Value = 1