Don't fail if we can't acquire readonly lock
Don't fail if we can't acquire readonly lock

This commit updates support from #6940 to not only gracefully handle
situations where the lock can be acquired in readonly but not read/write
mode but also handle situations where even a readonly lock can't be
acquired. If a readonly lock can't be acquired (and the read/write
failed) then we likely can't touch anything in the directory, so there's
no value gained from locking anyway.

Closes #7147

tsurai/cargo,eminence/cargo,tshepang/cargo,rustyhorde/cargo,tshepang/cargo,tsurai/cargo,rust-lang/cargo,tsurai/cargo,rustyhorde/cargo,nipunn1313/cargo,eminence/cargo,vojtechkral/cargo,rust-lang/cargo,rust-lang/cargo,nipunn1313/cargo,tsurai/cargo,vojtechkral/cargo,vojtechkral/cargo,rustyhorde/cargo,nipunn1313/cargo,eminence/cargo,tshepang/cargo,rust-lang/cargo,tsurai/cargo,rustyhorde/cargo,vojtechkral/cargo,nipunn1313/cargo,eminence/cargo,tshepang/cargo