abspath: add a function to resolve paths with missing components