Forbid Merge Down if either layer is locked

Locking layers should mean that their contents can't be changed, and the
Merge Down code correctly raises an assertion when it detects this
condition. However the layers should be greyed out too. Fix the resultant
exception by indicating in the query that locked layers cannot be sources
or targets for Merge Down.

Fixes #38.