Make sure copy actions are disabled when database is locked.

Closes #189
Merge remote-tracking branch 'upstream/master'

Sync with upstream