Support newer vagrant

The VM ID is stored in a file and .vagrant is a directory in newer vagrants.
This checks whether .vagrant is a directory or a file and uses the appropriate
method.