build_library: make sure /etc/mtab is correct before modifying images

If mtab ever gets replaced by a regular file all sorts of things break.