Locking - Explicitly acquire a lock depending on the command

Commands which modify instances.yml should acquire a lock before doing
anything.  Commands which merely read may proceed without acquiring the
lock.

This addresses an issue where running "amp sql" interactively causes all
other amp commands to fail.