core: Use the path from code:lib_dir to find zotonic's lib_dir, otherwise use the old method. Fixes #529