newdb: Fix move_library() broken on case-insenstive file systems

get_top_level_move_items() was not checking that the items it returned
actually existed on case-insensitive file systems. This bug is actually
present in olddb as well.
Fix refresh() test failling on OS X because of file system resolution
Fix test failures due to file locking on windows