RF: raise error if overwriting libraries

Check if we are going to overwrite a library by doing a copy, and raise
and error if so.  Test.