sort lfs.dir result; bail out if file open fails

- lfs.dir does not necessarily sort by filename, so we need to sort to process in correct order if applying multiple migrations at once
- if iopen fails, bail out with an error and show what went wrong